public static function Role::postLoad in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role::postLoad()
- 9 core/modules/user/src/Entity/Role.php \Drupal\user\Entity\Role::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
- core/
modules/ user/ src/ Entity/ Role.php, line 168
Class
- Role
- Defines the user role entity class.
Namespace
Drupal\user\EntityCode
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::class,
'sort',
]);
}