You are here

public function Page::variantSortHelper in Page Manager 8.4

Same name and namespace in other branches
  1. 8 src/Entity/Page.php \Drupal\page_manager\Entity\Page::variantSortHelper()

File

src/Entity/Page.php, line 439

Class

Page
Defines a Page entity class.

Namespace

Drupal\page_manager\Entity

Code

public function variantSortHelper($a, $b) {
  $a_weight = $a
    ->getWeight();
  $b_weight = $b
    ->getWeight();
  if ($a_weight == $b_weight) {
    return 0;
  }
  return $a_weight < $b_weight ? -1 : 1;
}