W3cubDocs

/Drupal 8

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. Note that the data type of a list is always 'list'.

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

Hierarchy

See also

\Drupal\Core\TypedData\ListDefinitionInterface

Related topics

Typed Data API
API for describing data based on a set of available data types.

File

core/lib/Drupal/Core/TypedData/ListInterface.php, line 18

Namespace

Drupal\Core\TypedData

Members

Name Modifiers Type Description
ListInterface::appendItem public function Appends a new item to the list.
ListInterface::filter public function Filters the items in the list using a custom callback.
ListInterface::first public function Returns the first item in this list.
ListInterface::get public function Returns the item at the specified position in this list.
ListInterface::getDataDefinition public function Gets the data definition. Overrides TypedDataInterface::getDataDefinition
ListInterface::getItemDefinition public function Gets the definition of a contained item.
ListInterface::isEmpty public function Determines whether the list contains any non-empty items.
ListInterface::removeItem public function Removes the item at the specified position.
ListInterface::set public function Sets the value of the item at a given position in the list.
TraversableTypedDataInterface::onChange public function React to changes to a child property or item.
TypedDataInterface::applyDefaultValue public function Applies the default value.
TypedDataInterface::createInstance public static function Constructs a TypedData object given its definition and context.
TypedDataInterface::getConstraints public function Gets a list of validation constraints.
TypedDataInterface::getName public function Returns the name of a property or item.
TypedDataInterface::getParent public function Returns the parent data structure; i.e. either complex data or a list.
TypedDataInterface::getPropertyPath public function Returns the property path of the data.
TypedDataInterface::getRoot public function Returns the root of the typed data tree.
TypedDataInterface::getString public function Returns a string representation of the data.
TypedDataInterface::getValue public function Gets the data value.
TypedDataInterface::setContext public function Sets the context of a property or item via a context aware parent.
TypedDataInterface::setValue public function Sets the data value.
TypedDataInterface::validate public function Validates the currently set data value.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!ListInterface.php/interface/ListInterface/8.1.x