Action::sort

public static Action::sort(ConfigEntityInterface $a, ConfigEntityInterface $b)

Helper callback for uasort() to sort configuration entities by weight and label.

Overrides ConfigEntityBase::sort

File

core/modules/system/src/Entity/Action.php, line 142

Class

Action
Defines the configured action entity.

Namespace

Drupal\system\Entity

Code

public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
  /** @var \Drupal\system\ActionConfigEntityInterface $a */
  /** @var \Drupal\system\ActionConfigEntityInterface $b */
  $a_type = $a->getType();
  $b_type = $b->getType();
  if ($a_type != $b_type) {
    return strnatcasecmp($a_type, $b_type);
  }
  return parent::sort($a, $b);
}
doc_Drupal
2016-10-29 08:43:05
Comments
Leave a Comment

Please login to continue.