interface YamlFormInterface in YAML Form 8
Provides an interface defining a form entity.
Hierarchy
- interface \Drupal\Core\Config\Entity\ConfigEntityInterface; interface \Drupal\Core\Entity\EntityWithPluginCollectionInterface; interface \Drupal\user\EntityOwnerInterface
- interface \Drupal\yamlform\YamlFormInterface
Expanded class hierarchy of YamlFormInterface
All classes that implement YamlFormInterface
38 files declare their use of YamlFormInterface
- ContainerBase.php in src/
Plugin/ YamlFormElement/ ContainerBase.php - Table.php in src/
Plugin/ YamlFormElement/ Table.php - TestYamlFormHandler.php in tests/
modules/ yamlform_test/ src/ Plugin/ YamlFormHandler/ TestYamlFormHandler.php - yamlform.module in ./
yamlform.module - Enables the creation of forms and questionnaires.
- YamlForm.php in src/
Entity/ YamlForm.php
File
- src/
YamlFormInterface.php, line 13
Namespace
Drupal\yamlformView source
interface YamlFormInterface extends ConfigEntityInterface, EntityWithPluginCollectionInterface, EntityOwnerInterface {
/**
* Determine if the form has page or is attached to other entities.
*
* @return bool
* TRUE if the form is a page with dedicated path.
*/
public function hasPage();
/**
* Determine if the form's elements include a managed_file upload element.
*
* @return bool
* TRUE if the form's elements include a managed_file upload element.
*/
public function hasManagedFile();
/**
* Determine if the form is using a Flexbox layout.
*
* @return bool
* TRUE if if the form is using a Flexbox layout.
*/
public function hasFlexboxLayout();
/**
* Returns the form opened status indicator.
*
* @return bool
* TRUE if the form is open to new submissions.
*/
public function isOpen();
/**
* Returns the form closed status indicator.
*
* @return bool
* TRUE if the form is closed to new submissions.
*/
public function isClosed();
/**
* Returns the form template indicator.
*
* @return bool
* TRUE if the form is a template and available for duplication.
*/
public function isTemplate();
/**
* Returns the form confidential indicator.
*
* @return bool
* TRUE if the form is confidential .
*/
public function isConfidential();
/**
* Checks if a form has submissions.
*
* @return bool
* TRUE if the form has submissions.
*/
public function hasSubmissions();
/**
* Determine if the current form is translated.
*
* @return bool
* TRUE if the current form is translated.
*/
public function hasTranslations();
/**
* Returns the form's description.
*
* @return string
* A form's description.
*/
public function getDescription();
/**
* Sets a form's description.
*
* @param string $description
* A description.
*
* @return $this
*/
public function setDescription($description);
/**
* Returns the form's CSS.
*
* @return string
* The form's CSS.
*/
public function getCss();
/**
* Sets the form's CSS.
*
* @param string $css
* The form's CSS.
*
* @return $this
*/
public function setCss($css);
/**
* Returns the form's JavaScript.
*
* @return string
* The form's CSS.
*/
public function getJavaScript();
/**
* Sets the form's JavaScript.
*
* @param string $javascript
* The form's JavaScript.
*
* @return $this
*/
public function setJavaScript($javascript);
/**
* Returns the form settings.
*
* @return array
* A structured array containing all the form settings.
*/
public function getSettings();
/**
* Sets the form settings.
*
* @param array $settings
* The structured array containing all the form setting.
*
* @return $this
*/
public function setSettings(array $settings);
/**
* Returns the form settings for a given key.
*
* @param string $key
* The key of the setting to retrieve.
*
* @return mixed
* The settings value, or NULL if no settings exists.
*/
public function getSetting($key);
/**
* Saves a form setting for a given key.
*
* @param string $key
* The key of the setting to store.
* @param mixed $value
* The data to store.
*
* @return $this
*/
public function setSetting($key, $value);
/**
* Returns the form access controls.
*
* @return array
* A structured array containing all the form access controls.
*/
public function getAccessRules();
/**
* Sets the form access.
*
* @param array $access
* The structured array containing all the form access controls.
*
* @return $this
*/
public function setAccessRules(array $access);
/**
* Returns the form default settings.
*
* @return array
* A structured array containing all the form default settings.
*/
public static function getDefaultSettings();
/**
* Returns the form default access controls.
*
* @return array
* A structured array containing all the form default access controls.
*/
public static function getDefaultAccessRules();
/**
* Checks form access to an operation on a form's submission.
*
* @param string $operation
* The operation access should be checked for.
* Usually "create", "view", "update", "delete", "purge", or "admin".
* @param \Drupal\Core\Session\AccountInterface $account
* The user session for which to check access.
* @param \Drupal\yamlform\YamlFormSubmissionInterface|null $yamlform_submission
* (optional) A form submission.
*
* @return bool
* The access result. Returns a TRUE if access is allowed.
*/
public function checkAccessRules($operation, AccountInterface $account, YamlFormSubmissionInterface $yamlform_submission = NULL);
/**
* Get form submission form.
*
* @param array $values
* (optional) An array of values to set, keyed by property name.
* @param string $operation
* (optional) The operation identifying the form variation to be returned.
* Defaults to 'default'. This is typically used in routing.
*
* @return array
* A render array representing a form submission form.
*/
public function getSubmissionForm(array $values = [], $operation = 'default');
/**
* Get elements (YAML) value.
*
* @return string
* The elements raw value.
*/
public function getElementsRaw();
/**
* Get original elements (YAML) value.
*
* @return string|null
* The original elements' raw value. Original elements is NULL for new YAML
* forms.
*/
public function getElementsOriginalRaw();
/**
* Get form elements decoded as an associative array.
*
* @return array|bool
* Elements as an associative array. Returns FALSE is elements YAML is invalid.
*/
public function getElementsDecoded();
/**
* Set element properties.
*
* @param string $key
* The element's key.
* @param array $properties
* An associative array of properties.
* @param string $parent_key
* (optional) The element's parent key. Only used for new elements.
*
* @return $this
*/
public function setElementProperties($key, array $properties, $parent_key = '');
/**
* Remove an element.
*
* @param string $key
* The element's key.
*/
public function deleteElement($key);
/**
* Get form elements initialized as an associative array.
*
* @return array|bool
* Elements as an associative array. Returns FALSE is elements YAML is invalid.
*/
public function getElementsInitialized();
/**
* Get form raw elements decoded and flattened into an associative array.
*
* @return array
* Form raw elements decoded and flattened into an associative array
* keyed by element name. Returns FALSE is elements YAML is invalid.
*/
public function getElementsDecodedAndFlattened();
/**
* Get form elements initialized and flattened into an associative array.
*
* @return array
* Form elements flattened into an associative array keyed by element name.
* Returns FALSE is elements YAML is invalid.
*/
public function getElementsInitializedAndFlattened();
/**
* Get form flattened list of elements.
*
* @return array
* Form elements flattened into an associative array keyed by element name.
*/
public function getElementsFlattenedAndHasValue();
/**
* Get form elements selectors as options.
*
* @return array
* Form elements selectors as options.
*/
public function getElementsSelectorOptions();
/**
* Sets elements (YAML) value.
*
* @param array $elements
* An renderable array of elements.
*
* @return $this
*/
public function setElements(array $elements);
/**
* Get a form's initialized element.
*
* @param string $key
* The element's key.
*
* @return array|null
* An associative array containing an initialized element.
*/
public function getElement($key);
/**
* Get a form's raw (uninitialized) element.
*
* @param string $key
* The element's key.
*
* @return array|null
* An associative array containing an raw (uninitialized) element.
*/
public function getElementDecoded($key);
/**
* Get form wizard pages.
*
* @return array
* An associative array of form pages.
*/
public function getPages();
/**
* Get form wizard page.
*
* @param string|int $key
* The name/key of a form wizard page.
*
* @return array|null
* A form wizard page element.
*/
public function getPage($key);
/**
* Update submit and confirm paths (ie URL aliases) associated with this form.
*/
public function updatePaths();
/**
* Update submit and confirm paths associated with this form.
*/
public function deletePaths();
/**
* Returns a specific form handler.
*
* @param string $handler_id
* The form handler ID.
*
* @return \Drupal\yamlform\YamlFormHandlerInterface
* The form handler object.
*/
public function getHandler($handler_id);
/**
* Returns the form handlers for this form.
*
* @param string $plugin_id
* (optional) Plugin id used to return specific plugin instances
* (ie handlers).
* @param bool $status
* (optional) Status used to return enabled or disabled plugin instances
* (ie handlers).
* @param int $results
* (optional) Value indicating if form submissions are saved to internal or
* external system.
*
* @return \Drupal\yamlform\YamlFormHandlerPluginCollection|\Drupal\yamlform\YamlFormHandlerInterface[]
* The form handler plugin collection.
*/
public function getHandlers($plugin_id = NULL, $status = NULL, $results = NULL);
/**
* Saves a form handler for this form.
*
* @param array $configuration
* An array of form handler configuration.
*
* @return string
* The form handler ID.
*/
public function addYamlFormHandler(array $configuration);
/**
* Deletes a form handler from this style.
*
* @param \Drupal\yamlform\YamlFormHandlerInterface $effect
* The form handler object.
*
* @return $this
*/
public function deleteYamlFormHandler(YamlFormHandlerInterface $effect);
/**
* Invoke a handlers method.
*
* @param string $method
* The handle method to be invoked.
* @param mixed $data
* The argument to passed by reference to the handler method.
*/
public function invokeHandlers($method, &$data, &$context1 = NULL, &$context2 = NULL);
/**
* Invoke elements method.
*
* @param string $method
* The handle method to be invoked.
* @param mixed $data
* The argument to passed by reference to the handler method.
*/
public function invokeElements($method, &$data, &$context1 = NULL, &$context2 = NULL);
/**
* Required to allow form which are config entities to have an EntityViewBuilder.
*
* Prevents:
* Fatal error: Call to undefined method
* Drupal\yamlform\Entity\YamlForm::isDefaultRevision()
* in /private/var/www/sites/d8_dev/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
* on line 169
*
* @see \Drupal\Core\Entity\RevisionableInterface::isDefaultRevision()
*
* @return bool
* Always return TRUE since config entities are not revisionable.
*/
public function isDefaultRevision();
/**
* Returns the stored value for a given key in the form's state.
*
* @param string $key
* The key of the data to retrieve.
* @param mixed $default
* The default value to use if the key is not found.
*
* @return mixed
* The stored value, or NULL if no value exists.
*/
public function getState($key, $default = NULL);
/**
* Saves a value for a given key in the form's state.
*
* @param string $key
* The key of the data to store.
* @param mixed $value
* The data to store.
*/
public function setState($key, $value);
/**
* Deletes an item from the form's state.
*
* @param string $key
* The item name to delete.
*/
public function deleteState($key);
/**
* Determine if the stored value for a given key exists in the form's state.
*
* @param string $key
* The key of the data to retrieve.
*
* @return bool
* TRUE if the stored value for a given key exists
*/
public function hasState($key);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AccessibleInterface:: |
public | function | Checks data value access. | 9 |
CacheableDependencyInterface:: |
public | function | The cache contexts associated with this object. | 34 |
CacheableDependencyInterface:: |
public | function | The maximum age for which this object may be cached. | 34 |
CacheableDependencyInterface:: |
public | function | The cache tags associated with this object. | 27 |
ConfigEntityInterface:: |
public | function | Calculates dependencies and stores them in the dependency property. | 2 |
ConfigEntityInterface:: |
public | function | Disables the configuration entity. | 2 |
ConfigEntityInterface:: |
public | function | Enables the configuration entity. | 2 |
ConfigEntityInterface:: |
public | function | Returns the value of a property. | 2 |
ConfigEntityInterface:: |
public | function | Gets the configuration dependencies. | 2 |
ConfigEntityInterface:: |
public | function | Gets whether on not the data is trusted. | 2 |
ConfigEntityInterface:: |
public | function | Checks whether this entity is installable. | 2 |
ConfigEntityInterface:: |
public | function | Returns whether this entity is being changed during the uninstall process. | 2 |
ConfigEntityInterface:: |
public | function | Informs the entity that entities it depends on will be deleted. | 2 |
ConfigEntityInterface:: |
public | function | Sets the value of a property. | 2 |
ConfigEntityInterface:: |
public | function | Sets the status of the configuration entity. | 2 |
ConfigEntityInterface:: |
public | function | Returns whether the configuration entity is enabled. | 2 |
ConfigEntityInterface:: |
public | function | Sets that the data should be trusted. | 2 |
EntityInterface:: |
public | function | Gets the bundle of the entity. | 2 |
EntityInterface:: |
public static | function | Constructs a new entity object, without permanently saving it. | 2 |
EntityInterface:: |
public | function | Creates a duplicate of the entity. | 2 |
EntityInterface:: |
public | function | Deletes an entity permanently. | 2 |
EntityInterface:: |
public | function | Enforces an entity to be new. | 2 |
EntityInterface:: |
public | function | Returns the cache tags that should be used to invalidate caches. | 2 |
EntityInterface:: |
public | function | Gets the key that is used to store configuration dependencies. | 2 |
EntityInterface:: |
public | function | Gets the configuration dependency name. | 2 |
EntityInterface:: |
public | function | Gets the configuration target identifier for the entity. | 2 |
EntityInterface:: |
public | function | Gets the entity type definition. | 2 |
EntityInterface:: |
public | function | Gets the ID of the type of the entity. | 2 |
EntityInterface:: |
public | function | Gets the original ID. | 2 |
EntityInterface:: |
public | function | Gets a typed data object for this entity object. | 2 |
EntityInterface:: |
public | function | Indicates if a link template exists for a given key. | 2 |
EntityInterface:: |
public | function | Gets the identifier. | 2 |
EntityInterface:: |
public | function | Determines whether the entity is new. | 2 |
EntityInterface:: |
public | function | Gets the label of the entity. | 2 |
EntityInterface:: |
public | function | Gets the language of the entity. | 2 |
EntityInterface:: |
public | function | Deprecated way of generating a link to the entity. See toLink(). | 2 |
EntityInterface:: |
public static | function | Loads an entity. | 2 |
EntityInterface:: |
public static | function | Loads one or more entities. | 2 |
EntityInterface:: |
public | function | Acts on a created entity before hooks are invoked. | 2 |
EntityInterface:: |
public static | function | Acts on deleted entities before the delete hook is invoked. | 2 |
EntityInterface:: |
public static | function | Acts on loaded entities. | 3 |
EntityInterface:: |
public | function | Acts on a saved entity before the insert or update hook is invoked. | 2 |
EntityInterface:: |
public static | function | Changes the values of an entity before it is created. | 2 |
EntityInterface:: |
public static | function | Acts on entities before they are deleted and before hooks are invoked. | 2 |
EntityInterface:: |
public | function | Acts on an entity before the presave hook is invoked. | 2 |
EntityInterface:: |
public | function | Gets a list of entities referenced by this entity. | 2 |
EntityInterface:: |
public | function | Saves an entity permanently. | 2 |
EntityInterface:: |
public | function | Sets the original ID. | 2 |
EntityInterface:: |
public | function | Gets an array of all property values. | 3 |
EntityInterface:: |
public | function | Generates the HTML for a link to this entity. | 2 |
EntityInterface:: |
public | function | Gets the URL object for the entity. | 2 |
EntityInterface:: |
public | function | Gets a list of URI relationships supported by this entity. | 2 |
EntityInterface:: |
public | function | Gets the public URL for this entity. | 2 |
EntityInterface:: |
public | function | Gets the URL object for the entity. | 2 |
EntityInterface:: |
public | function | Gets the entity UUID (Universally Unique Identifier). | 2 |
EntityOwnerInterface:: |
public | function | Returns the entity owner's user entity. | 1 |
EntityOwnerInterface:: |
public | function | Returns the entity owner's user ID. | 1 |
EntityOwnerInterface:: |
public | function | Sets the entity owner's user entity. | 1 |
EntityOwnerInterface:: |
public | function | Sets the entity owner's user ID. | 1 |
ObjectWithPluginCollectionInterface:: |
public | function | Gets the plugin collections used by this object. | 11 |
RefinableCacheableDependencyInterface:: |
public | function | Adds a dependency on an object: merges its cacheability metadata. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds cache contexts. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds cache tags. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Merges the maximum age (in seconds) with the existing maximum age. | 1 |
SynchronizableInterface:: |
public | function | Returns whether this entity is being changed as part of a synchronization. | 1 |
SynchronizableInterface:: |
public | function | Sets the status of the synchronization flag. | 1 |
ThirdPartySettingsInterface:: |
public | function | Gets the list of third parties that store information. | 5 |
ThirdPartySettingsInterface:: |
public | function | Gets the value of a third-party setting. | 5 |
ThirdPartySettingsInterface:: |
public | function | Gets all third-party settings of a given module. | 5 |
ThirdPartySettingsInterface:: |
public | function | Sets the value of a third-party setting. | 5 |
ThirdPartySettingsInterface:: |
public | function | Unsets a third-party setting. | 5 |
YamlFormInterface:: |
public | function | Saves a form handler for this form. | 1 |
YamlFormInterface:: |
public | function | Checks form access to an operation on a form's submission. | 1 |
YamlFormInterface:: |
public | function | Remove an element. | 1 |
YamlFormInterface:: |
public | function | Update submit and confirm paths associated with this form. | 1 |
YamlFormInterface:: |
public | function | Deletes an item from the form's state. | 1 |
YamlFormInterface:: |
public | function | Deletes a form handler from this style. | 1 |
YamlFormInterface:: |
public | function | Returns the form access controls. | 1 |
YamlFormInterface:: |
public | function | Returns the form's CSS. | 1 |
YamlFormInterface:: |
public static | function | Returns the form default access controls. | 1 |
YamlFormInterface:: |
public static | function | Returns the form default settings. | 1 |
YamlFormInterface:: |
public | function | Returns the form's description. | 1 |
YamlFormInterface:: |
public | function | Get a form's initialized element. | 1 |
YamlFormInterface:: |
public | function | Get a form's raw (uninitialized) element. | 1 |
YamlFormInterface:: |
public | function | Get form elements decoded as an associative array. | 1 |
YamlFormInterface:: |
public | function | Get form raw elements decoded and flattened into an associative array. | 1 |
YamlFormInterface:: |
public | function | Get form flattened list of elements. | 1 |
YamlFormInterface:: |
public | function | Get form elements initialized as an associative array. | 1 |
YamlFormInterface:: |
public | function | Get form elements initialized and flattened into an associative array. | 1 |
YamlFormInterface:: |
public | function | Get original elements (YAML) value. | 1 |
YamlFormInterface:: |
public | function | Get elements (YAML) value. | 1 |
YamlFormInterface:: |
public | function | Get form elements selectors as options. | 1 |
YamlFormInterface:: |
public | function | Returns a specific form handler. | 1 |
YamlFormInterface:: |
public | function | Returns the form handlers for this form. | 1 |
YamlFormInterface:: |
public | function | Returns the form's JavaScript. | 1 |
YamlFormInterface:: |
public | function | Get form wizard page. | 1 |
YamlFormInterface:: |
public | function | Get form wizard pages. | 1 |
YamlFormInterface:: |
public | function | Returns the form settings for a given key. | 1 |
YamlFormInterface:: |
public | function | Returns the form settings. | 1 |
YamlFormInterface:: |
public | function | Returns the stored value for a given key in the form's state. | 1 |
YamlFormInterface:: |
public | function | Get form submission form. | 1 |
YamlFormInterface:: |
public | function | Determine if the form is using a Flexbox layout. | 1 |
YamlFormInterface:: |
public | function | Determine if the form's elements include a managed_file upload element. | 1 |
YamlFormInterface:: |
public | function | Determine if the form has page or is attached to other entities. | 1 |
YamlFormInterface:: |
public | function | Determine if the stored value for a given key exists in the form's state. | 1 |
YamlFormInterface:: |
public | function | Checks if a form has submissions. | 1 |
YamlFormInterface:: |
public | function | Determine if the current form is translated. | 1 |
YamlFormInterface:: |
public | function | Invoke elements method. | 1 |
YamlFormInterface:: |
public | function | Invoke a handlers method. | 1 |
YamlFormInterface:: |
public | function | Returns the form closed status indicator. | 1 |
YamlFormInterface:: |
public | function | Returns the form confidential indicator. | 1 |
YamlFormInterface:: |
public | function | Required to allow form which are config entities to have an EntityViewBuilder. | 1 |
YamlFormInterface:: |
public | function | Returns the form opened status indicator. | 1 |
YamlFormInterface:: |
public | function | Returns the form template indicator. | 1 |
YamlFormInterface:: |
public | function | Sets the form access. | 1 |
YamlFormInterface:: |
public | function | Sets the form's CSS. | 1 |
YamlFormInterface:: |
public | function | Sets a form's description. | 1 |
YamlFormInterface:: |
public | function | Set element properties. | 1 |
YamlFormInterface:: |
public | function | Sets elements (YAML) value. | 1 |
YamlFormInterface:: |
public | function | Sets the form's JavaScript. | 1 |
YamlFormInterface:: |
public | function | Saves a form setting for a given key. | 1 |
YamlFormInterface:: |
public | function | Sets the form settings. | 1 |
YamlFormInterface:: |
public | function | Saves a value for a given key in the form's state. | 1 |
YamlFormInterface:: |
public | function | Update submit and confirm paths (ie URL aliases) associated with this form. | 1 |