You are here

protected function ModerationStateTransitionStorage::mapFromStorageRecords in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 src/ModerationStateTransitionStorage.php \Drupal\workbench_moderation\ModerationStateTransitionStorage::mapFromStorageRecords()

Maps from storage records to entity objects.

Parameters

array $records: Associative array of query results, keyed on the entity ID.

Return value

\Drupal\Core\Entity\EntityInterface[] An array of entity objects implementing the EntityInterface.

Overrides EntityStorageBase::mapFromStorageRecords

File

src/ModerationStateTransitionStorage.php, line 61

Class

ModerationStateTransitionStorage
Define class for moderation state transitions.

Namespace

Drupal\workbench_moderation

Code

protected function mapFromStorageRecords(array $records) {
  $entities = parent::mapFromStorageRecords($records);
  $prefix = $this->entityTypeManager
    ->getDefinition('moderation_state')
    ->getConfigPrefix();

  /* @var \Drupal\workbench_moderation\ModerationStateTransitionInterface $entity */
  foreach ($entities as &$entity) {
    $entity
      ->setModerationStateConfigPrefix($prefix);
  }
  reset($entities);
  return $entities;
}