You are here

interface YamlFormSubmissionStorageInterface in YAML Form 8

Defines an interface for form submission classes.

Hierarchy

Expanded class hierarchy of YamlFormSubmissionStorageInterface

All classes that implement YamlFormSubmissionStorageInterface

2 files declare their use of YamlFormSubmissionStorageInterface
YamlFormResultsCustomForm.php in src/Form/YamlFormResultsCustomForm.php
YamlFormSubmissionsDeleteFormBase.php in src/Form/YamlFormSubmissionsDeleteFormBase.php

File

src/YamlFormSubmissionStorageInterface.php, line 12

Namespace

Drupal\yamlform
View source
interface YamlFormSubmissionStorageInterface extends ContentEntityStorageInterface {

  /**
   * Return status for saving of YAML forb submission when saving results is disabled.
   */
  const SAVED_DISABLED = 0;

  /**
   * Get form submission entity field definitions.
   *
   * The helper method is generally used for exporting results.
   *
   * @see \Drupal\yamlform\Element\YamlFormExcludedColumns
   * @see \Drupal\yamlform\Controller\YamlFormResultsExportController
   *
   * @return array
   *   An associative array of field definition key by field name containing
   *   title, name, and datatype.
   */
  public function getFieldDefinitions();

  /**
   * Returns a form's max serial number.
   *
   * @param \Drupal\yamlform\YamlFormInterface $yamlform
   *   A form.
   *
   * @return int
   *   The next serial number.
   */
  public function getMaxSerial(YamlFormInterface $yamlform);

  /**
   * Delete all form submissions.
   *
   * @param \Drupal\yamlform\YamlFormInterface|null $yamlform
   *   (optional) The form to delete the submissions from.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   (optional) A form submission source entity.
   * @param int $limit
   *   (optional) Number of submissions to be deleted.
   * @param int $max_sid
   *   (optional) Maximum form submission id.
   *
   * @return int
   *   The number of form submissions deleted.
   */
  public function deleteAll(YamlFormInterface $yamlform = NULL, EntityInterface $source_entity = NULL, $limit = NULL, $max_sid = NULL);

  /**
   * Get form submission draft.
   *
   * @param \Drupal\yamlform\YamlFormInterface|null $yamlform
   *   A form.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface|null $account
   *   A user account.
   *
   * @return \Drupal\yamlform\YamlFormSubmissionInterface
   *   A form submission.
   */
  public function loadDraft(YamlFormInterface $yamlform, EntityInterface $source_entity = NULL, AccountInterface $account = NULL);

  /**
   * Get the total number of submissions.
   *
   * @param \Drupal\yamlform\YamlFormInterface|null $yamlform
   *   (optional) A form. If set the total number of submissions for the
   *   Form will be returned.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   (optional) A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface|null $account
   *   (optional) A user account.
   *
   * @return int
   *   Total number of submissions.
   */
  public function getTotal(YamlFormInterface $yamlform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL);

  /**
   * Get the maximum sid.
   *
   * @param \Drupal\yamlform\YamlFormInterface|null $yamlform
   *   (optional) A form. If set the total number of submissions for the
   *   Form will be returned.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   (optional) A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface|null $account
   *   (optional) A user account.
   *
   * @return int
   *   Total number of submissions.
   */
  public function getMaxSubmissionId(YamlFormInterface $yamlform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL);

  /**
   * Get a form's first submission.
   *
   * @param \Drupal\yamlform\YamlFormInterface $yamlform
   *   A form.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   (optional) A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The current user account.
   *
   * @return \Drupal\yamlform\YamlFormSubmissionInterface|null
   *   The form's first submission.
   */
  public function getFirstSubmission(YamlFormInterface $yamlform, EntityInterface $source_entity = NULL, AccountInterface $account = NULL);

  /**
   * Get a form's last submission.
   *
   * @param \Drupal\yamlform\YamlFormInterface $yamlform
   *   A form.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   (optional) A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The current user account.
   *
   * @return \Drupal\yamlform\YamlFormSubmissionInterface|null
   *   The form's last submission.
   */
  public function getLastSubmission(YamlFormInterface $yamlform, EntityInterface $source_entity = NULL, AccountInterface $account = NULL);

  /**
   * Get a form submission's previous sibling.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   (optional) A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The current user account.
   *
   * @return \Drupal\yamlform\YamlFormSubmissionInterface|null
   *   The form submission's previous sibling.
   */
  public function getPreviousSubmission(YamlFormSubmissionInterface $yamlform_submission, EntityInterface $source_entity = NULL, AccountInterface $account = NULL);

  /**
   * Get a form submission's next sibling.
   *
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   (optional) A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The current user account.
   *
   * @return \Drupal\yamlform\YamlFormSubmissionInterface|null
   *   The form submission's next sibling.
   */
  public function getNextSubmission(YamlFormSubmissionInterface $yamlform_submission, EntityInterface $source_entity = NULL, AccountInterface $account = NULL);

  /**
   * Get form submission source entity types.
   *
   * @param \Drupal\yamlform\YamlFormInterface $yamlform
   *   A form.
   *
   * @return array
   *   An array of entity types that the form has been submitted from.
   */
  public function getSourceEntityTypes(YamlFormInterface $yamlform);

  /**
   * Get customized submission columns used to display custom table.
   *
   * @param \Drupal\yamlform\YamlFormInterface|null $yamlform
   *   A form.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface|null $account
   *   A user account.
   *
   * @return array|mixed
   *   An associative array of columns keyed by name.
   */
  public function getCustomColumns(YamlFormInterface $yamlform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL, $include_elements = TRUE);

  /**
   * Get default submission columns used to display results.
   *
   * @param \Drupal\yamlform\YamlFormInterface|null $yamlform
   *   A form.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface|null $account
   *   A user account.
   *
   * @return array|mixed
   *   An associative array of columns keyed by name.
   */
  public function getDefaultColumns(YamlFormInterface $yamlform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL, $include_elements = TRUE);

  /**
   * Get submission columns used to display results table.
   *
   * @param \Drupal\yamlform\YamlFormInterface|null $yamlform
   *   A form.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   A form submission source entity.
   * @param \Drupal\Core\Session\AccountInterface|null $account
   *   A user account.
   *
   * @return array|mixed
   *   An associative array of columns keyed by name.
   */
  public function getColumns(YamlFormInterface $yamlform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL, $include_elements = TRUE);

  /**
   * Get customize setting.
   *
   * @param string $name
   *   Custom settings name.
   * @param mixed $default
   *   Custom settings default value.
   * @param \Drupal\yamlform\YamlFormInterface|null $yamlform
   *   A form.
   * @param \Drupal\Core\Entity\EntityInterface|null $source_entity
   *   A form submission source entity.
   *
   * @return mixed
   *   Custom setting.
   */
  public function getCustomSetting($name, $default, YamlFormInterface $yamlform = NULL, EntityInterface $source_entity = NULL);

  /**
   * Invoke a form submission's form's handlers method.
   *
   * @param string $method
   *   The form handler method to be invoked.
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   * @param mixed $context1
   *   (optional) An additional variable that is passed by reference.
   * @param mixed $context2
   *   (optional) An additional variable that is passed by reference.
   */
  public function invokeYamlFormHandlers($method, YamlFormSubmissionInterface $yamlform_submission, &$context1 = NULL, &$context2 = NULL);

  /**
   * Invoke a form submission's form's elements method.
   *
   * @param string $method
   *   The form element method to be invoked.
   * @param \Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission
   *   A form submission.
   * @param mixed $context1
   *   (optional) An additional variable that is passed by reference.
   * @param mixed $context2
   *   (optional) An additional variable that is passed by reference.
   */
  public function invokeYamlFormElements($method, YamlFormSubmissionInterface $yamlform_submission, &$context1 = NULL, &$context2 = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
ContentEntityStorageInterface::createWithSampleValues public function Creates an entity with sample field values. 2
EntityStorageInterface::create public function Constructs a new entity object, without permanently saving it. 1
EntityStorageInterface::delete public function Deletes permanently saved entities. 1
EntityStorageInterface::deleteRevision public function Delete a specific entity revision. 4
EntityStorageInterface::FIELD_LOAD_CURRENT constant Load the most recent version of an entity's field data.
EntityStorageInterface::FIELD_LOAD_REVISION constant Load the version of an entity's field data specified in the entity.
EntityStorageInterface::getAggregateQuery public function Gets an aggregated query instance. 1
EntityStorageInterface::getEntityType public function Gets the entity type definition. 1
EntityStorageInterface::getEntityTypeId public function Gets the entity type ID. 1
EntityStorageInterface::getQuery public function Gets an entity query instance. 1
EntityStorageInterface::hasData public function Determines if the storage contains any data. 1
EntityStorageInterface::load public function Loads one entity. 1
EntityStorageInterface::loadByProperties public function Load entities by their property values. 1
EntityStorageInterface::loadMultiple public function Loads one or more entities. 1
EntityStorageInterface::loadRevision public function Load a specific entity revision. 4
EntityStorageInterface::loadUnchanged public function Loads an unchanged entity from the database. 1
EntityStorageInterface::resetCache public function Resets the internal, static entity cache. 1
EntityStorageInterface::restore public function Restores a previously saved entity. 1
EntityStorageInterface::save public function Saves the entity permanently. 1
RevisionableStorageInterface::getLatestRevisionId public function Returns the latest revision identifier for an entity. 2
RevisionableStorageInterface::loadMultipleRevisions public function Loads multiple entity revisions. 2
TranslatableRevisionableStorageInterface::createRevision public function Creates a new revision starting off from the specified entity object. Overrides RevisionableStorageInterface::createRevision 2
TranslatableRevisionableStorageInterface::getLatestTranslationAffectedRevisionId public function Returns the latest revision affecting the specified translation. 2
TranslatableStorageInterface::createTranslation public function Constructs a new entity translation object, without permanently saving it. 2
YamlFormSubmissionStorageInterface::deleteAll public function Delete all form submissions. 1
YamlFormSubmissionStorageInterface::getColumns public function Get submission columns used to display results table. 1
YamlFormSubmissionStorageInterface::getCustomColumns public function Get customized submission columns used to display custom table. 1
YamlFormSubmissionStorageInterface::getCustomSetting public function Get customize setting. 1
YamlFormSubmissionStorageInterface::getDefaultColumns public function Get default submission columns used to display results. 1
YamlFormSubmissionStorageInterface::getFieldDefinitions public function Get form submission entity field definitions. 1
YamlFormSubmissionStorageInterface::getFirstSubmission public function Get a form's first submission. 1
YamlFormSubmissionStorageInterface::getLastSubmission public function Get a form's last submission. 1
YamlFormSubmissionStorageInterface::getMaxSerial public function Returns a form's max serial number. 1
YamlFormSubmissionStorageInterface::getMaxSubmissionId public function Get the maximum sid. 1
YamlFormSubmissionStorageInterface::getNextSubmission public function Get a form submission's next sibling. 1
YamlFormSubmissionStorageInterface::getPreviousSubmission public function Get a form submission's previous sibling. 1
YamlFormSubmissionStorageInterface::getSourceEntityTypes public function Get form submission source entity types. 1
YamlFormSubmissionStorageInterface::getTotal public function Get the total number of submissions. 1
YamlFormSubmissionStorageInterface::invokeYamlFormElements public function Invoke a form submission's form's elements method. 1
YamlFormSubmissionStorageInterface::invokeYamlFormHandlers public function Invoke a form submission's form's handlers method. 1
YamlFormSubmissionStorageInterface::loadDraft public function Get form submission draft. 1
YamlFormSubmissionStorageInterface::SAVED_DISABLED constant Return status for saving of YAML forb submission when saving results is disabled.