You are here

protected function TransactionDetailsItemList::ensureCalculated in Transaction 8

Calculates the value of the item list and sets it.

3 calls to TransactionDetailsItemList::ensureCalculated()
TransactionDetailsItemList::getIterator in src/Plugin/Field/TransactionDetailsItemList.php
TransactionDetailsItemList::getValue in src/Plugin/Field/TransactionDetailsItemList.php
Gets the data value.
TransactionDetailsItemList::isEmpty in src/Plugin/Field/TransactionDetailsItemList.php
Determines whether the list contains any non-empty items.

File

src/Plugin/Field/TransactionDetailsItemList.php, line 53

Class

TransactionDetailsItemList
Transaction details field type item list.

Namespace

Drupal\transaction\Plugin\Field

Code

protected function ensureCalculated() {
  if (!$this->isCalculated) {
    foreach ($this
      ->getEntity()
      ->getDetails(TRUE) as $delta => $value) {
      $this->list[$delta] = $this
        ->createItem($delta, $value);
    }
    $this->isCalculated = TRUE;
  }
}