You are here

public static function Filter::loadMultiple in Access Filter 8

Return value

\Drupal\access_filter\Entity\Filter[] An array of Filter entities.

Overrides EntityBase::loadMultiple

1 call to Filter::loadMultiple()
AccessFilterMiddleware::handle in src/AccessFilterMiddleware.php

File

src/Entity/Filter.php, line 119

Class

Filter
Defines the Filter entity.

Namespace

Drupal\access_filter\Entity

Code

public static function loadMultiple(array $ids = NULL) {

  /** @var \Drupal\access_filter\Entity\Filter[] $filters */
  $filters = parent::loadMultiple($ids);
  uasort($filters, function ($a, $b) {
    if ($a->weight == $b->weight) {
      return 0;
    }
    return $a->weight < $b->weight ? -1 : 1;
  });
  return $filters;
}