class ComputedReferenceTestFieldItemList

Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedReferenceTestFieldItemList.php \Drupal\entity_test\Plugin\Field\ComputedReferenceTestFieldItemList
  2. 8.9.x core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedReferenceTestFieldItemList.php \Drupal\entity_test\Plugin\Field\ComputedReferenceTestFieldItemList
  3. 10 core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedReferenceTestFieldItemList.php \Drupal\entity_test\Plugin\Field\ComputedReferenceTestFieldItemList

A computed entity reference field item list.

Hierarchy

Expanded class hierarchy of ComputedReferenceTestFieldItemList

2 files declare their use of ComputedReferenceTestFieldItemList
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/ComputedReferenceTestFieldItemList.php, line 13

Namespace

Drupal\entity_test\Plugin\Field
View source
class ComputedReferenceTestFieldItemList extends EntityReferenceFieldItemList {
    use ComputedItemListTrait;
    
    /**
     * Compute the list property from state.
     */
    protected function computeValue() {
        foreach (\Drupal::state()->get('entity_test_reference_computed_target_ids', []) as $delta => $id) {
            $this->list[$delta] = $this->createItem($delta, $id);
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
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 1
ComputedReferenceTestFieldItemList::computeValue protected function Compute the list property from state. Overrides ComputedItemListTrait::computeValue
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
EntityReferenceFieldItemList::defaultValuesFormSubmit public function Overrides FieldItemList::defaultValuesFormSubmit
EntityReferenceFieldItemList::getConstraints public function Overrides FieldItemList::getConstraints
EntityReferenceFieldItemList::processDefaultValue public static function Overrides FieldItemList::processDefaultValue
EntityReferenceFieldItemList::referencedEntities public function Overrides EntityReferenceFieldItemListInterface::referencedEntities
FieldItemList::$langcode protected property The langcode of the field values held in the object.
FieldItemList::$list protected property Numerically indexed array of field items. Overrides ItemList::$list 1
FieldItemList::access public function Overrides AccessibleInterface::access 1
FieldItemList::createItem protected function Overrides ItemList::createItem
FieldItemList::defaultAccess public function Overrides FieldItemListInterface::defaultAccess 3
FieldItemList::defaultValuesForm public function Overrides FieldItemListInterface::defaultValuesForm 2
FieldItemList::defaultValuesFormValidate public function Overrides FieldItemListInterface::defaultValuesFormValidate 2
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 Overrides FieldItemListInterface::delete 2
FieldItemList::deleteRevision public function Overrides FieldItemListInterface::deleteRevision 1
FieldItemList::equals public function Overrides FieldItemListInterface::equals 2
FieldItemList::filterEmptyItems public function Overrides FieldItemListInterface::filterEmptyItems
FieldItemList::generateSampleItems public function Overrides FieldItemListInterface::generateSampleItems 1
FieldItemList::getEntity public function Overrides FieldItemListInterface::getEntity 1
FieldItemList::getFieldDefinition public function Overrides FieldItemListInterface::getFieldDefinition
FieldItemList::getLangcode public function Overrides FieldItemListInterface::getLangcode
FieldItemList::getSetting public function Overrides FieldItemListInterface::getSetting
FieldItemList::getSettings public function Overrides FieldItemListInterface::getSettings
FieldItemList::hasAffectingChanges public function Overrides FieldItemListInterface::hasAffectingChanges 1
FieldItemList::postSave public function Overrides FieldItemListInterface::postSave 1
FieldItemList::preSave public function Overrides FieldItemListInterface::preSave 1
FieldItemList::setLangcode public function Overrides FieldItemListInterface::setLangcode
FieldItemList::view public function Overrides FieldItemListInterface::view
FieldItemList::__get public function Overrides FieldItemListInterface::__get
FieldItemList::__isset public function Overrides FieldItemListInterface::__isset
FieldItemList::__set public function Overrides FieldItemListInterface::__set
FieldItemList::__unset public function Overrides FieldItemListInterface::__unset
ItemList::filter public function Overrides ListInterface::filter
ItemList::first public function Overrides ListInterface::first
ItemList::getItemDefinition public function Overrides ListInterface::getItemDefinition
ItemList::offsetGet public function
ItemList::offsetSet public function
ItemList::offsetUnset public function
ItemList::onChange public function Overrides TraversableTypedDataInterface::onChange 1
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. 3
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. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
TypedData::$definition protected property The data definition. 1
TypedData::$name protected property The property name.
TypedData::$parent protected property The parent typed data object.
TypedData::createInstance public static function Overrides TypedDataInterface::createInstance
TypedData::getDataDefinition public function Overrides TypedDataInterface::getDataDefinition
TypedData::getName public function Overrides TypedDataInterface::getName
TypedData::getParent public function Overrides TypedDataInterface::getParent
TypedData::getPluginDefinition public function Overrides PluginInspectionInterface::getPluginDefinition
TypedData::getPluginId public function Overrides PluginInspectionInterface::getPluginId
TypedData::getPropertyPath public function Overrides TypedDataInterface::getPropertyPath
TypedData::getRoot public function Overrides TypedDataInterface::getRoot
TypedData::setContext public function Overrides TypedDataInterface::setContext
TypedData::validate public function Overrides TypedDataInterface::validate
TypedData::__construct public function Constructs a TypedData object given its definition and context. 4
TypedDataTrait::$typedDataManager protected property The typed data manager used for creating the data types.
TypedDataTrait::getTypedDataManager public function Gets the typed data manager. 2
TypedDataTrait::setTypedDataManager public function Sets the typed data manager. 2

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.