public static function ConfigEntityBas8b7c:f320:99b9:690f:4595:cd17:293a:c069sort public static ConfigEntityBas8b7c:f320:99b9:690f:4595:cd17:293a:c069sort(ConfigEntityInterface $a, ConfigEntityInterface $b) Helper callback for uasort() to sort configuration entities by weight and label. File
 core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php, line 251  Class
 
ConfigEntityBase  Defines a base configuration entity class.  Namespace Drupal\Core\Config\Entity Code public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
  $a_weight = isset($a->weight) ? $a->weight : 0;
  $b_weight = isset($b->weight) ? $b->weight : 0;
  if ($a_weight == $b_weight) {
    $a_label = $a->label();
    $b_label = $b->label();
    return strnatcasecmp($a_label, $b_label);
  }
  return ($a_weight < $b_weight) ? -1 : 1;
}


    
{'path': 'public/docs/drupal~8/core-lib-drupal-core-config-entity-configentitybase.php/function/configentitybase-sort/8.1.x.html', 'source': 'DevDocs.IO'}