public static function FooTableBreakpoint::sort in FooTable 8
Same name and namespace in other branches
- 8.2 src/Entity/FooTableBreakpoint.php \Drupal\footable\Entity\FooTableBreakpoint::sort()
Helper callback for uasort() to sort configuration entities by weight and label.
Overrides ConfigEntityBase::sort
File
- src/
Entity/ FooTableBreakpoint.php, line 99
Class
- FooTableBreakpoint
- Defines the FooTable Breakpoint Config entity.
Namespace
Drupal\footable\EntityCode
public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
$a_breakpoint = $a
->getBreakpoint();
$b_breakpoint = $b
->getBreakpoint();
if ($a_breakpoint == $b_breakpoint) {
return strnatcasecmp($a
->label(), $b
->label());
}
return $a_breakpoint < $b_breakpoint ? -1 : 1;
}