DateFormat::sort

public static DateFormat::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/Datetime/Entity/DateFormat.php, line 87

Class

DateFormat
Defines the Date Format configuration entity class.

Namespace

Drupal\Core\Datetime\Entity

Code

public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
  if ($a->isLocked() == $b->isLocked()) {
    $a_label = $a->label();
    $b_label = $b->label();
    return strnatcasecmp($a_label, $b_label);
  }
  return $a->isLocked() ? 1 : -1;
}
doc_Drupal
2016-10-29 09:00:29
Comments
Leave a Comment

Please login to continue.