Role::postLoad

public static Role::postLoad(EntityStorageInterface $storage, array &$entities)

Acts on loaded entities.

Parameters

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

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

Overrides Entity::postLoad

File

core/modules/user/src/Entity/Role.php, line 161

Class

Role
Defines the user role entity class.

Namespace

Drupal\user\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');
}
doc_Drupal
2016-10-29 09:38:44
Comments
Leave a Comment

Please login to continue.