You are here

public static function Webform::sort in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Entity/Webform.php \Drupal\webform\Entity\Webform::sort()

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

Overrides ConfigEntityBase::sort

File

src/Entity/Webform.php, line 3242

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
  $a_label = $a
    ->get('category') . $a
    ->label();
  $b_label = $b
    ->get('category') . $b
    ->label();
  return strnatcasecmp($a_label, $b_label);
}