You are here

interface WebformCardsManagerInterface in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_cards/src/WebformCardsManagerInterface.php \Drupal\webform_cards\WebformCardsManagerInterface

Interface for webform cards manager.

Hierarchy

Expanded class hierarchy of WebformCardsManagerInterface

All classes that implement WebformCardsManagerInterface

File

modules/webform_cards/src/WebformCardsManagerInterface.php, line 11

Namespace

Drupal\webform_cards
View source
interface WebformCardsManagerInterface {

  /**
   * Determine if a webform has cards.
   *
   * @param \Drupal\webform\WebformInterface $webform
   *   A webform.
   *
   * @return bool
   *   TRUE if a webform has cards.
   */
  public function hasCards(WebformInterface $webform);

  /**
   * Counts the number of cards used in a webform.
   *
   * @param \Drupal\webform\WebformInterface $webform
   *   A webform.
   *
   * @return int
   *   The number of cards for the webform.
   */
  public function getNumberOfCards(WebformInterface $webform);

  /**
   * Build webform's cards based on the current operation.
   *
   * @param \Drupal\webform\WebformInterface $webform
   *   A webform.
   * @param string $operation
   *   The webform submission operation.
   *   Usually 'default', 'add', 'edit', 'edit_all', 'api', or 'test'.
   *
   * @return array
   *   An associative array of webform cards.
   *
   * @see \Drupal\webform\Entity\Webform::buildPages
   */
  public function buildPages(WebformInterface $webform, $operation = 'default');

  /**
   * Update cards pages based on conditional logic (#states).
   *
   * @param array $pages
   *   An associative array of webform cards.
   * @param \Drupal\webform\WebformSubmissionInterface|null $webform_submission
   *   A webform submission.
   *
   * @return array
   *   An associative array of webform cards with conditional logic applied.
   *
   * @see \Drupal\webform\Entity\Webform::getPages
   */
  public function applyConditions(array $pages, WebformSubmissionInterface $webform_submission = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
WebformCardsManagerInterface::applyConditions public function Update cards pages based on conditional logic (#states). 1
WebformCardsManagerInterface::buildPages public function Build webform's cards based on the current operation. 1
WebformCardsManagerInterface::getNumberOfCards public function Counts the number of cards used in a webform. 1
WebformCardsManagerInterface::hasCards public function Determine if a webform has cards. 1