class ComputedTestFieldItemList
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestFieldItemList.php \Drupal\entity_test\Plugin\Field\ComputedTestFieldItemList
- 10 core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestFieldItemList.php \Drupal\entity_test\Plugin\Field\ComputedTestFieldItemList
- 9 core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestFieldItemList.php \Drupal\entity_test\Plugin\Field\ComputedTestFieldItemList
- 8.9.x core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestFieldItemList.php \Drupal\entity_test\Plugin\Field\ComputedTestFieldItemList
A computed field item list.
Hierarchy
- class \Drupal\Core\TypedData\TypedData implements \Drupal\Core\TypedData\TypedDataInterface, \Drupal\Component\Plugin\PluginInspectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\TypedData\TypedDataTrait
- class \Drupal\Core\TypedData\Plugin\DataType\ItemList implements \Drupal\Core\TypedData\Plugin\DataType\IteratorAggregate, \Drupal\Core\TypedData\ListInterface extends \Drupal\Core\TypedData\TypedData
- class \Drupal\Core\Field\FieldItemList implements \Drupal\Core\Field\FieldItemListInterface extends \Drupal\Core\TypedData\Plugin\DataType\ItemList
- class \Drupal\entity_test\Plugin\Field\ComputedTestFieldItemList uses \Drupal\Core\TypedData\ComputedItemListTrait extends \Drupal\Core\Field\FieldItemList
- class \Drupal\Core\Field\FieldItemList implements \Drupal\Core\Field\FieldItemListInterface extends \Drupal\Core\TypedData\Plugin\DataType\ItemList
- class \Drupal\Core\TypedData\Plugin\DataType\ItemList implements \Drupal\Core\TypedData\Plugin\DataType\IteratorAggregate, \Drupal\Core\TypedData\ListInterface extends \Drupal\Core\TypedData\TypedData
Expanded class hierarchy of ComputedTestFieldItemList
2 files declare their use of ComputedTestFieldItemList
- EntityTestComputedBundleField.php in core/
modules/ system/ tests/ modules/ entity_test/ src/ Entity/ EntityTestComputedBundleField.php - EntityTestComputedField.php in core/
modules/ system/ tests/ modules/ entity_test/ src/ Entity/ EntityTestComputedField.php
File
-
core/
modules/ system/ tests/ modules/ entity_test/ src/ Plugin/ Field/ ComputedTestFieldItemList.php, line 13
Namespace
Drupal\entity_test\Plugin\FieldView source
class ComputedTestFieldItemList extends FieldItemList {
use ComputedItemListTrait;
/**
* Compute the list property from state.
*/
protected function computeValue() {
// Count the number of times this method has been executed during the
// lifecycle of an entity.
$execution_count = \Drupal::state()->get('computed_test_field_execution', 0);
\Drupal::state()->set('computed_test_field_execution', ++$execution_count);
foreach (\Drupal::state()->get('entity_test_computed_field_item_list_value', []) as $delta => $item) {
$this->list[$delta] = $this->createItem($delta, $item);
}
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
|---|---|---|---|---|
| ComputedItemListTrait::$valueComputed | protected | property | Whether the values have already been computed or not. | |
| ComputedItemListTrait::appendItem | public | function | ||
| ComputedItemListTrait::applyDefaultValue | public | function | ||
| ComputedItemListTrait::count | public | function | ||
| ComputedItemListTrait::ensureComputedValue | protected | function | Ensures that values are only computed once. | |
| ComputedItemListTrait::get | public | function | ||
| ComputedItemListTrait::getIterator | public | function | ||
| ComputedItemListTrait::getString | public | function | ||
| ComputedItemListTrait::getValue | public | function | ||
| ComputedItemListTrait::isEmpty | public | function | ||
| ComputedItemListTrait::offsetExists | public | function | ||
| ComputedItemListTrait::removeItem | public | function | ||
| ComputedItemListTrait::set | public | function | ||
| ComputedItemListTrait::setValue | public | function | ||
| ComputedTestFieldItemList::computeValue | protected | function | Compute the list property from state. | Overrides ComputedItemListTrait::computeValue |
| DependencySerializationTrait::$_entityStorages | protected | property | An array of entity type IDs keyed by the property name of their storages. | |
| DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. | |
| DependencySerializationTrait::__sleep | public | function | ||
| DependencySerializationTrait::__wakeup | public | function | ||
| FieldItemList::$langcode | protected | property | The langcode of the field values held in the object. | |
| FieldItemList::$list | protected | property | Numerically indexed array of field items. | |
| FieldItemList::access | public | function | ||
| FieldItemList::createItem | protected | function | ||
| FieldItemList::defaultAccess | public | function | ||
| FieldItemList::defaultValuesForm | public | function | ||
| FieldItemList::defaultValuesFormSubmit | public | function | ||
| FieldItemList::defaultValuesFormValidate | public | function | ||
| FieldItemList::defaultValueWidget | protected | function | Returns the widget object used in default value form. | |
| FieldItemList::delegateMethod | protected | function | Calls a method on each FieldItem. | |
| FieldItemList::delete | public | function | ||
| FieldItemList::deleteRevision | public | function | ||
| FieldItemList::equals | public | function | ||
| FieldItemList::filterEmptyItems | public | function | ||
| FieldItemList::generateSampleItems | public | function | ||
| FieldItemList::getConstraints | public | function | ||
| FieldItemList::getEntity | public | function | ||
| FieldItemList::getFieldDefinition | public | function | ||
| FieldItemList::getLangcode | public | function | ||
| FieldItemList::getSetting | public | function | ||
| FieldItemList::getSettings | public | function | ||
| FieldItemList::hasAffectingChanges | public | function | ||
| FieldItemList::postSave | public | function | ||
| FieldItemList::preSave | public | function | ||
| FieldItemList::processDefaultValue | public static | function | ||
| FieldItemList::setLangcode | public | function | ||
| FieldItemList::view | public | function | ||
| FieldItemList::__get | public | function | ||
| FieldItemList::__isset | public | function | ||
| FieldItemList::__set | public | function | ||
| FieldItemList::__unset | public | function | ||
| ItemList::filter | public | function | ||
| ItemList::first | public | function | ||
| ItemList::getItemDefinition | public | function | ||
| ItemList::last | public | function | ||
| ItemList::offsetGet | public | function | ||
| ItemList::offsetSet | public | function | ||
| ItemList::offsetUnset | public | function | ||
| ItemList::onChange | public | function | ||
| ItemList::rekey | protected | function | Renumbers the items in the list. | |
| ItemList::__clone | public | function | Magic method: Implements a deep clone. | |
| StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | |
| StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |
| StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |
| StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |
| StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | |
| StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | |
| TypedData::$definition | protected | property | The data definition. | |
| TypedData::$name | protected | property | The property name. | |
| TypedData::$parent | protected | property | The parent typed data object. | |
| TypedData::createInstance | public static | function | ||
| TypedData::getDataDefinition | public | function | ||
| TypedData::getName | public | function | ||
| TypedData::getParent | public | function | ||
| TypedData::getPluginDefinition | public | function | ||
| TypedData::getPluginId | public | function | ||
| TypedData::getPropertyPath | public | function | ||
| TypedData::getRoot | public | function | ||
| TypedData::setContext | public | function | ||
| TypedData::validate | public | function | ||
| TypedData::__construct | public | function | Constructs a TypedData object given its definition and context. | |
| TypedDataTrait::$typedDataManager | protected | property | The typed data manager used for creating the data types. | |
| TypedDataTrait::getTypedDataManager | public | function | Gets the typed data manager. | |
| TypedDataTrait::setTypedDataManager | public | function | Sets the typed data manager. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.