Interface for fields, being lists of field items.
Contained items must implement the FieldItemInterface. This interface is required for every property of an entity. Some methods are delegated to the first contained item, in particular get() and set() as well as their magic equivalences.
Optionally, a typed data object implementing Drupal\Core\TypedData\TypedDataInterface may be passed to ArrayAccess::offsetSet() instead of a plain value.
When implementing this interface which extends Traversable, make sure to list IteratorAggregate or Iterator before this interface in the implements clause.
Expanded class hierarchy of FieldInterface
All classes that implement FieldInterface
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AccessibleInterface:: |
public | function | Checks data value access. | 4 |
ContextAwareInterface:: |
public | function | Returns the name of a property or item. | 6 |
ContextAwareInterface:: |
public | function | Returns the parent data structure; i.e. either complex data or a list. | 6 |
ContextAwareInterface:: |
public | function | Sets the name of a property or item. | 6 |
ContextAwareInterface:: |
public | function | Sets the parent of a property or item. | 6 |
FieldInterface:: |
public | function | Delegates to the first item. | 1 |
FieldInterface:: |
public | function | Delegates to the first item. | 1 |
FieldInterface:: |
public | function | Delegates to the first item. | 1 |
FieldInterface:: |
public | function | Magic getter: Delegates to the first item. | 1 |
FieldInterface:: |
public | function | Magic method for isset(): Delegates to the first item. | 1 |
FieldInterface:: |
public | function | Magic setter: Delegates to the first item. | 1 |
FieldInterface:: |
public | function | Magic method for unset(): Delegates to the first item. | 1 |
ListInterface:: |
public | function | Determines whether the list contains any non-empty items. | 1 |
TypedDataInterface:: |
public | function | Gets the data definition. | 1 |
TypedDataInterface:: |
public | function | Returns a string representation of the data. | 1 |
TypedDataInterface:: |
public | function | Gets the data type. | 1 |
TypedDataInterface:: |
public | function | Gets the data value. | 1 |
TypedDataInterface:: |
public | function | Sets the data value. | 1 |
TypedDataInterface:: |
public | function | Validates the currently set data value. | 13 |