You are here

public static function Template::postLoad in Wysiwyg API template plugin 8.2

Same name and namespace in other branches
  1. 3.0.x src/Entity/Template.php \Drupal\wysiwyg_template\Entity\Template::postLoad()

Acts on loaded entities.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.

Overrides EntityBase::postLoad

File

src/Entity/Template.php, line 136

Class

Template
Defines the Template entity.

Namespace

Drupal\wysiwyg_template\Entity

Code

public static function postLoad(EntityStorageInterface $storage, array &$entities) {
  parent::postLoad($storage, $entities);

  // Sort the queried roles by their weight.
  // See \Drupal\Core\Config\Entity\ConfigEntityBase::sort().
  uasort($entities, 'static::sort');
}