interface ListInterface

Interface for a list of typed data.

A list of typed data contains only items of the same type, is ordered and may contain duplicates.

When implementing this interface which extends Traversable, make sure to list IteratorAggregate or Iterator before this interface in the implements clause.

Hierarchy

Expanded class hierarchy of ListInterface

All classes that implement ListInterface

5 files declare their use of ListInterface
Context.php in drupal/core/lib/Drupal/Core/Plugin/Context/Context.php
Contains \Drupal\Core\Plugin\Context\Context.
FieldInterface.php in drupal/core/lib/Drupal/Core/Entity/Field/FieldInterface.php
Contains \Drupal\Core\Entity\Field\FieldInterface.
MetadataFactory.php in drupal/core/lib/Drupal/Core/TypedData/Validation/MetadataFactory.php
Contains \Drupal\Core\TypedData\Validation\MetadataFactory.
PropertyContainerMetadata.php in drupal/core/lib/Drupal/Core/TypedData/Validation/PropertyContainerMetadata.php
Contains \Drupal\Core\TypedData\Validation\PropertyContainerMetadata.
Sequence.php in drupal/core/lib/Drupal/Core/Config/Schema/Sequence.php
Contains \Drupal\Core\Config\Schema\Sequence.

File

drupal/core/lib/Drupal/Core/TypedData/ListInterface.php, line 23
Contains \Drupal\Core\TypedData\ListInterface.

Namespace

Drupal\Core\TypedData
View source
interface ListInterface extends TypedDataInterface, ArrayAccess, Countable, Traversable {

  /**
   * Determines whether the list contains any non-empty items.
   *
   * @return boolean
   *   TRUE if the list is empty, FALSE otherwise.
   */
  public function isEmpty();

  /**
   * Gets the definition of a contained item.
   *
   * @return array
   *   The data definition of contained items.
   */
  public function getItemDefinition();

  /**
   * React to changes to a child item.
   *
   * Note that this is invoked before any changes are applied.
   *
   * @param $delta
   *   The delta of the item which is changed.
   */
  public function onChange($delta);

}

Members

Namesort descending Modifiers Type Description Overrides
ListInterface::getItemDefinition public function Gets the definition of a contained item. 2
ListInterface::isEmpty public function Determines whether the list contains any non-empty items. 2
ListInterface::onChange public function React to changes to a child item. 2
TypedDataInterface::getConstraints public function Gets a list of validation constraints. 4
TypedDataInterface::getDefinition public function Gets the data definition. 4
TypedDataInterface::getName public function Returns the name of a property or item. 4
TypedDataInterface::getParent public function Returns the parent data structure; i.e. either complex data or a list. 4
TypedDataInterface::getPropertyPath public function Returns the property path of the data. 4
TypedDataInterface::getRoot public function Returns the root of the typed data tree. 4
TypedDataInterface::getString public function Returns a string representation of the data. 4
TypedDataInterface::getType public function Gets the data type. 5
TypedDataInterface::getValue public function Gets the data value. 4
TypedDataInterface::setContext public function Sets the context of a property or item via a context aware parent. 4
TypedDataInterface::setValue public function Sets the data value. 4
TypedDataInterface::validate public function Validates the currently set data value. 4