Get locations.

@return array
Locations.
356746
public function getLocations() {
    $locations = [];

    $cid = __METHOD__;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $branches = $this->client->getBranches(['limit' => 100]);
    foreach ($branches as $branch) {
      $locations[$branch->id] = $branch->name;
    }

    $this->cache->set($cid, $locations);
    return $locations;
  }
541578
public function getPlacehodlerParameters(): array
	{
		if (!empty($this->placeholder_order)) {
			return array_filter($this->placeholder_order);
		}

		$return = [];

		preg_replace_callback('/<(\w+)>/', function ($item) use (&$return) {
			$return[] = end($item);
		}, $this->path);

		return $return;
	}
733649
public function getLocationPins() {
    $activeTypes = \Drupal::configFactory()->get('openy_map.settings')->get('active_types');
    $activeTypes = !empty($activeTypes) ? array_keys(array_filter($activeTypes)) : [];
    $pins = [];
    foreach ($activeTypes as $type) {
      $typePins = $this->getPins($type);
      $pins = array_merge($pins, $typePins);
    }
    return $pins;
  }
869112
private function getStores()
    {
        $collection = $this->getRetailerCollection();
        $cacheKey   = sprintf("%s_%s", 'checkout_storedelivery', $collection->getStoreId());

        $markers = $this->cache->load($cacheKey);
        if (!$markers) {
            $markers = [];
            /** @var RetailerInterface $retailer */
            foreach ($collection as $retailer) {
                $address    = $retailer->getExtensionAttributes()->getAddress();
                $coords     = $address->getCoordinates();
                $markerData = [
                    'id'           => $retailer->getId(),
                    'latitude'     => $coords->getLatitude(),
                    'longitude'    => $coords->getLongitude(),
                    'name'         => $retailer->getName(),
                    'address'      => $this->addressFormatter->formatAddress($address, AddressFormatter::FORMAT_ONELINE),
                    'url'          => $this->storeLocatorHelper->getRetailerUrl($retailer),
                    'directionUrl' => $this->map->getDirectionUrl($address->getCoordinates()),
                    'setStoreData' => $this->getSetStorePostData($retailer),
                    'addressData'  => $address->getData(),
                ];

                $markerData['schedule'] = array_merge(
                    $this->scheduleHelper->getConfig(),
                    [
                        'calendar'            => $this->scheduleManager->getCalendar($retailer),
                        'openingHours'        => $this->scheduleManager->getWeekOpeningHours($retailer),
                        'specialOpeningHours' => $retailer->getExtensionAttributes()->getSpecialOpeningHours(),
                    ]
                );

                $markers[] = $markerData;
            }

            $markers = json_encode($markers);
            $this->cache->save(
                $markers,
                $cacheKey,
                $collection->getNewEmptyItem()->getCacheTags()
            );
        }

        return json_decode($markers);
    }
1327632
private function getCharacterAssetLocations(): array
    {

        $assets = CharacterAsset::where('character_id', $this->getCharacterId())
            ->where('location_flag', 'Hangar')
            ->where('location_type', 'other')
            // Asset Safety
            ->where('location_id', '<>', self::ASSET_SAFETY)
            // Solar Systems
            ->whereNotBetween('location_id', self::SOLAR_SYSTEMS_RANGE)
            // Bugged Assets
            ->whereNotBetween('location_id', self::BUGGED_ASSETS_RANGE)
            // Station / Outpost
            ->whereNotBetween('location_id', self::UPWELL_STRUCTURES_RANGE)
            // stuffs
            ->whereNotIn('location_id', function ($query) {
                $query->select('item_id')
                    ->from((new CharacterAsset)->getTable())
                    ->where('character_id', $this->getCharacterId())
                    ->distinct();
            })
            // Remove structures that already have a name resolved
            // within the last week.
            ->whereNotIn('location_id', function ($query) {

                $query->select('structure_id')
                    ->from((new UniverseStructure)->getTable())
                    ->where('name', '<>', 'Unknown Structure')
                    ->where('updated_at', '<', carbon('now')->subWeek());
            })
            ->select('location_id')->distinct()
            // Until CCP can sort out this endpoint, pick 30 random locations
            // and try to get those names. We hard cap it at 30 otherwise we
            // will quickly kill the error limit, resulting in a ban.
            ->inRandomOrder()
            ->limit(15)
            ->get();

        return $assets->map(function ($asset) {

            return $asset->location_id;

        })->all();
    }
463057
public function getDirections()
	{
		if($this->_directions===null)
		{
			$this->_directions=array();
			if(isset($_GET[$this->sortVar]) && is_string($_GET[$this->sortVar]))
			{
				$attributes=explode($this->separators[0],$_GET[$this->sortVar]);
				foreach($attributes as $attribute)
				{
					if(($pos=strrpos($attribute,$this->separators[1]))!==false)
					{
						$descending=substr($attribute,$pos+1)===$this->descTag;
						if($descending)
							$attribute=substr($attribute,0,$pos);
					}
					else
						$descending=false;

					if(($this->resolveAttribute($attribute))!==false)
					{
						$this->_directions[$attribute]=$descending;
						if(!$this->multiSort)
							return $this->_directions;
					}
				}
			}
			if($this->_directions===array() && is_array($this->defaultOrder))
				$this->_directions=$this->defaultOrder;
		}
		return $this->_directions;
	}
1079839
protected function getAvailableSites()
	{
		$manager = \Aimeos\MShop::create( Scheduler\Base::getContext(), 'locale/site' );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'locale.site.level', 0 ) );
		$search->setSortations( array( $search->sort( '+', 'locale.site.label' ) ) );

		$sites = $manager->searchItems( $search );

		foreach( $sites as $id => $siteItem ) {
			$sites[$id] = $manager->getTree( $id, array(), \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE );
		}

		return $sites;
	}
42201
public function getLocators()
    {
        $result = array();
        if(is_array($this->__locators)) {
            $result = array_keys($this->__locators);
        }

        return $result;
    }
807981
public function getCampaignSeries()
    {
        $locationFacts = $this->getLocationFacts();
        $seriesData = [];
        $metricIds = [];

        foreach ($locationFacts as $locationFact) {
            $factsData = $this->getFacts($locationFact->getLocation());
            $seriesData[] = [
                'location' => $locationFact->getLocation(),
                'dimensions' => $factsData,
            ];

            $usedMetricIds = array_keys($factsData);
            foreach ($usedMetricIds as $metricId) {
                if (in_array($metricId, $metricIds)) {
                    continue;
                }
                $metricIds[] = $metricId;
            }
        }

        return [
            'data' => $seriesData,
            'metricNames' => $this->getMetricNamesById($metricIds),
        ];
    }
191345
public function getLocationsInfo() {
    $data = [];
    $cid = 'openy_activity_finder:locations_info';
    if ($cache = $this->cache->get($cid)) {
      $data = $cache->data;
    }
    else {
      $nids = $this->entityQuery
        ->get('node')
        ->condition('type', ['branch', 'camp'], 'IN')
        ->execute();
      $nids_chunked = array_chunk($nids, 20, TRUE);
      foreach ($nids_chunked as $chunked) {
        $locations = $this->entityTypeManager->getStorage('node')->loadMultiple($chunked);
        if (!empty($locations)) {
          foreach ($locations as $location) {
            $address = implode(', ', [
              $location->field_location_address->address_line1,
              $location->field_location_address->locality,
              $location->field_location_address->administrative_area,
              $location->field_location_address->postal_code,
            ]);
            $days = [];
            foreach ($location->field_branch_hours as $multi_hours) {
              $sub_hours = $multi_hours->getValue();
              $days = [
                [
                  0 => "Mon - Fri:",
                  1 => $sub_hours['hours_mon']
                ],
                [
                  0 => "Sat - Sun:",
                  1 => $sub_hours['hours_sat']
                ]
              ];
            }
            $data[$location->title->value] =[
              'type' => $location->bundle(),
              'address' => $address,
              'days' => $days,
              'email' => $location->field_location_email->value,
              'nid' => $location->id(),
              'phone' => $location->field_location_phone->value,
              'title' => $location->title->value
            ];
          }
        }
      }
      $expire = $this->time->getRequestTime() + self::CACHE_TTL;
      $this->cache->set($cid, $data, $expire);
    }

    return $data;
  }
541085
protected function getExcludeLocationMapIds() {
    $config = $this->configFactory->get('openy_programs_search.settings');
    $exclude_location_map = $config->get('exclude_location_map');

    return is_array($exclude_location_map) ? $exclude_location_map : [];
  }
212656
public function getCoordinates()
    {
        $coords = [];

        if (!empty($this->spatial)) {
            foreach ($this->spatial as $column) {
                $clear = trim(preg_replace('/[a-zA-Z\(\)]/', '', $this->getLocation($column)));
                if (!empty($clear)) {
                    foreach (explode(',', $clear) as $point) {
                        list($lat, $lng) = explode(' ', $point);
                        $coords[] = [
                            'lat' => $lat,
                            'lng' => $lng,
                        ];
                    }
                }
            }
        }

        return $coords;
    }
358421
public function getLocation()
    {
        if ($this->location === null) {
            $this->location = new GeoLocation($this->getLat(), $this->getLng());
        }

        return $this->location;
    }
1050063
public function getAvailableLocales()
    {
        $availableLocales = [];
        $translations = $this->getTranslations();
        foreach ($translations as $translation) {
            $availableLocales[] = $translation->getLocale();
        }

        return $availableLocales;
    }
931248
public function getLocation() : ?string 
    {
        if ( ! $this->hasLocation()) {
            $this->setLocation($this->getDefaultLocation());
        }
        return $this->location;
    }
1291511
protected function getGeoCodeData()
    {
        $result = [];
        foreach ($this->userLocations as $data) {
            $result[] = [
                'country' => ArrayHelper::getValue($data['location'], 'country'),
                'address' => implode(',', ArrayHelper::getValue($data, 'location')),
                'htmlContent' => ArrayHelper::getValue($data, 'htmlContent'),
            ];
        }

        return $result;
    }
473733
public function location()
    {
        $result = $this->sendCommand('element/:id/location', WebDriver_Command::METHOD_GET);
        $value = $result['value'];
        return ['x' => $value['x'], 'y' => $value['y']];
    }