interface WebformElementManagerInterface in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformElementManagerInterface.php \Drupal\webform\Plugin\WebformElementManagerInterface
Collects available webform elements.
Hierarchy
- interface \Drupal\Component\Plugin\PluginManagerInterface; interface \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface; interface \Drupal\Component\Plugin\FallbackPluginManagerInterface; interface \Drupal\Component\Plugin\CategorizingPluginManagerInterface; interface \Drupal\webform\Plugin\WebformPluginManagerExcludedInterface
- interface \Drupal\webform\Plugin\WebformElementManagerInterface
Expanded class hierarchy of WebformElementManagerInterface
All classes that implement WebformElementManagerInterface
14 files declare their use of WebformElementManagerInterface
- webform.tokens.inc in ./
webform.tokens.inc - Builds placeholder replacement tokens for webforms and submissions.
- WebformAdminConfigBaseForm.php in src/
Form/ AdminConfig/ WebformAdminConfigBaseForm.php - WebformCardsManager.php in modules/
webform_cards/ src/ WebformCardsManager.php - WebformDevelSchema.php in modules/
webform_devel/ src/ WebformDevelSchema.php - WebformEntityConditionsManager.php in src/
WebformEntityConditionsManager.php
File
- src/
Plugin/ WebformElementManagerInterface.php, line 15
Namespace
Drupal\webform\PluginView source
interface WebformElementManagerInterface extends PluginManagerInterface, CachedDiscoveryInterface, FallbackPluginManagerInterface, CategorizingPluginManagerInterface, WebformPluginManagerExcludedInterface {
/**
* Get all available webform element plugin instances.
*
* @return \Drupal\webform\Plugin\WebformElementInterface[]
* An array of all available webform element plugin instances.
*/
public function getInstances();
/**
* Build a Webform element.
*
* @param array $element
* An associative array containing an element with a #type property.
*/
public function initializeElement(array &$element);
/**
* Build a Webform element.
*
* @param array $element
* An associative array containing an element with a #type property.
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @see hook_webform_element_alter()
* @see hook_webform_element_ELEMENT_TYPE_alter()
* @see \Drupal\webform\WebformSubmissionForm::prepareElements
*/
public function buildElement(array &$element, array $form, FormStateInterface $form_state);
/**
* Process a form element and apply webform element specific enhancements.
*
* This method allows any form API element to be enhanced using webform
* specific features include custom validation, external libraries,
* accessibility improvements, etc…
*
* @param array $element
* An associative array containing an element with a #type property.
*
* @return array
* The processed form element with webform element specific enhancements.
*/
public function processElement(array &$element);
/**
* Process form elements and apply webform element specific enhancements.
*
* This method allows any form API elements to be enhanced using webform
* specific features include custom validation, external libraries,
* accessibility improvements, etc…
*
* @param array $elements
* An associative array containing form elements.
*
* @return array
* The processed form elements with webform element specific enhancements.
*/
public function processElements(array &$elements);
/**
* Invoke a method for a Webform element.
*
* @param string $method
* The method name.
* @param array $element
* An associative array containing an element with a #type property.
* @param mixed $context1
* (optional) An additional variable that is passed by reference.
* @param mixed $context2
* (optional) An additional variable that is passed by reference. If more
* context needs to be provided to implementations, then this should be an
* associative array as described above.
*
* @return mixed|null
* Return result of the invoked method. NULL will be returned if the
* element and/or method name does not exist.
*
* @see \Drupal\webform\WebformSubmissionForm::prepareElements
*/
public function invokeMethod($method, array &$element, &$context1 = NULL, &$context2 = NULL);
/**
* Is an element's plugin id.
*
* @param array $element
* A element.
*
* @return string
* An element's $type has a corresponding plugin id, else
* fallback 'element' plugin id.
*/
public function getElementPluginId(array $element);
/**
* Get a webform element plugin instance for an element.
*
* @param array $element
* An associative array containing an element with a #type property.
* @param \Drupal\webform\WebformInterface|\Drupal\webform\WebformSubmissionInterface $entity
* A webform or webform submission entity.
*
* @return \Drupal\webform\Plugin\WebformElementInterface
* A webform element plugin instance
*
* @throws \Exception
* Throw exception if entity type is not a webform or webform submission.
*/
public function getElementInstance(array $element, EntityInterface $entity = NULL);
/**
* Gets sorted plugin definitions.
*
* @param array[]|null $definitions
* (optional) The plugin definitions to sort. If omitted, all plugin
* definitions are used.
* @param string $sort_by
* The property to sort plugin definitions by. Only 'label' and 'category'
* are supported. Defaults to label.
*
* @return array[]
* An array of plugin definitions, sorted by category and label.
*/
public function getSortedDefinitions(array $definitions = NULL, $sort_by = 'label');
/**
* Get all translatable properties from all elements.
*
* @return array
* An array of translatable properties.
*/
public function getTranslatableProperties();
/**
* Get all properties for all elements.
*
* @return array
* An array of all properties.
*/
public function getAllProperties();
/**
* Determine if an element type is excluded.
*
* @param string $type
* The element type.
*
* @return bool
* TRUE if the element is excluded.
*/
public function isExcluded($type);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CachedDiscoveryInterface:: |
public | function | Clears static and persistent plugin definition caches. | 1 |
CachedDiscoveryInterface:: |
public | function | Disable the use of caches. | 1 |
CategorizingPluginManagerInterface:: |
public | function | Gets the names of all categories. | 1 |
CategorizingPluginManagerInterface:: |
public | function | Gets sorted plugin definitions grouped by category. | 1 |
DiscoveryInterface:: |
public | function | Gets a specific plugin definition. | 4 |
DiscoveryInterface:: |
public | function | Gets the definition of all plugins for this type. | 3 |
DiscoveryInterface:: |
public | function | Indicates if a specific plugin definition exists. | 1 |
FactoryInterface:: |
public | function | Creates a pre-configured instance of a plugin. | 6 |
FallbackPluginManagerInterface:: |
public | function | Gets a fallback id for a missing plugin. | 5 |
MapperInterface:: |
public | function | Gets a preconfigured instance of a plugin. | 3 |
WebformElementManagerInterface:: |
public | function | Build a Webform element. | 1 |
WebformElementManagerInterface:: |
public | function | Get all properties for all elements. | 1 |
WebformElementManagerInterface:: |
public | function | Get a webform element plugin instance for an element. | 1 |
WebformElementManagerInterface:: |
public | function | Is an element's plugin id. | 1 |
WebformElementManagerInterface:: |
public | function | Get all available webform element plugin instances. | 1 |
WebformElementManagerInterface:: |
public | function |
Gets sorted plugin definitions. Overrides CategorizingPluginManagerInterface:: |
1 |
WebformElementManagerInterface:: |
public | function | Get all translatable properties from all elements. | 1 |
WebformElementManagerInterface:: |
public | function | Build a Webform element. | 1 |
WebformElementManagerInterface:: |
public | function | Invoke a method for a Webform element. | 1 |
WebformElementManagerInterface:: |
public | function | Determine if an element type is excluded. | 1 |
WebformElementManagerInterface:: |
public | function | Process a form element and apply webform element specific enhancements. | 1 |
WebformElementManagerInterface:: |
public | function | Process form elements and apply webform element specific enhancements. | 1 |
WebformPluginManagerExcludedInterface:: |
public | function | Remove excluded plugin definitions. | 4 |