public function ItemList::first in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php \Drupal\Core\TypedData\Plugin\DataType\ItemList::first()
Returns the first item in this list.
Return value
\Drupal\Core\TypedData\TypedDataInterface The first item in this list.
Throws
\Drupal\Core\TypedData\Exception\MissingDataException If the complex data structure is unset and no item can be created.
Overrides ListInterface::first
5 calls to ItemList::first()
- FieldItemList::applyDefaultValue in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Applies the default value.
- FieldItemList::__get in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Magic method: Gets a property value of to the first field item.
- FieldItemList::__isset in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Magic method: Determines whether a property of the first field item is set.
- FieldItemList::__set in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Magic method: Sets a property value of the first field item.
- FieldItemList::__unset in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Magic method: Unsets a property of the first field item.
File
- core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ ItemList.php, line 170 - Contains \Drupal\Core\TypedData\Plugin\DataType\ItemList.
Class
- ItemList
- A generic list class.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
public function first() {
return $this
->get(0);
}