You are here

public function HelperService::getPlacesInUse in Weather 8

Same name and namespace in other branches
  1. 2.0.x src/Service/HelperService.php \Drupal\weather\Service\HelperService::getPlacesInUse()

Get all currently used places for a display.

Parameters

string $display_type: Display type.

int $display_number: Display number.

Return value

array Array of sorted places.

File

src/Service/HelperService.php, line 173

Class

HelperService
HelperService service.

Namespace

Drupal\weather\Service

Code

public function getPlacesInUse($display_type, $display_number) {
  $result = $this->weatherDisplayPlaceStorage
    ->getQuery()
    ->condition('display_type', $display_type)
    ->condition('display_number', $display_number)
    ->sort('weight', 'ASC')
    ->sort('displayed_name', 'ASC')
    ->execute();
  if ($result) {
    $result = $this->weatherDisplayPlaceStorage
      ->loadMultiple($result);
  }
  return $result;
}