You are here

protected function TransactionResultMessageItemList::ensurePopulated in Transaction 8

Calculates the value of the item list and sets it.

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

File

src/Plugin/Field/TransactionResultMessageItemList.php, line 46

Class

TransactionResultMessageItemList
Item list for the computed field transaction execution result message.

Namespace

Drupal\transaction\Plugin\Field

Code

protected function ensurePopulated() {
  if (!isset($this->list[0])) {

    /** @var \Drupal\transaction\TransactionInterface $entity */
    $entity = $this
      ->getEntity();
    if (!$entity
      ->isPending()) {
      $this->list[0] = $this
        ->createItem(0, $entity
        ->getResultMessage(TRUE));
    }
  }
}