You are here

public static function Country::sort in Ubercart 8.4

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

Overrides ConfigEntityBase::sort

File

uc_country/src/Entity/Country.php, line 139

Class

Country
Defines the uc_country type configuration entity.

Namespace

Drupal\uc_country\Entity

Code

public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
  $a_status = (int) $a
    ->status();
  $b_status = (int) $b
    ->status();
  if ($a_status != $b_status) {
    return $a_status > $b_status ? -1 : 1;
  }
  return parent::sort($a, $b);
}