You are here

public static function Webform::sort in Webform 6.x

Same name and namespace in other branches
  1. 8.5 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 3243

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);
}