public static EntityDisplayModeBase::sort(ConfigEntityInterface $a, ConfigEntityInterface $b)
Helper callback for uasort() to sort configuration entities by weight and label.
Overrides ConfigEntityBase::sort
File
- core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php, line 59
Class
- EntityDisplayModeBase
- Base class for config entity types with settings for form and view modes.
Namespace
Drupal\Core\Entity
Code
1 2 3 4 5 6 7 8 9 | public static function sort(ConfigEntityInterface $a , ConfigEntityInterface $b ) { /** @var \Drupal\Core\Entity\EntityDisplayModeInterface $a */ /** @var \Drupal\Core\Entity\EntityDisplayModeInterface $b */ // Sort by the type of entity the view mode is used for. $a_type = $a ->getTargetType(); $b_type = $b ->getTargetType(); $type_order = strnatcasecmp ( $a_type , $b_type ); return $type_order != 0 ? $type_order : parent::sort( $a , $b ); } |
Please login to continue.