function ComputedTestBundleFieldItemList::computeValue

Compute the list property from state.

Overrides ComputedItemListTrait::computeValue

File

core/modules/system/tests/modules/entity_test/src/Plugin/Field/ComputedTestBundleFieldItemList.php, line 18

Class

ComputedTestBundleFieldItemList
A computed field item list for a bundle field.

Namespace

Drupal\entity_test\Plugin\Field

Code

protected function computeValue() {
  foreach (\Drupal::state()->get('entity_test_comp_bund_fld_item_list_value', []) as $delta => $item) {
    $this->list[$delta] = $this->createItem($delta, $item);
  }
}

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