You are here

protected function ModerationStateTransitionStorage::mapFromStorageRecords in Workbench Moderation 8.2

Same name and namespace in other branches
  1. 8 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 57

Class

ModerationStateTransitionStorage

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;
}