Get the total number of all Locations, except the Root node.

@see loadAllLocationsData

@return int
179118
public function countAllLocations()
    {
        try {
            return $this->innerGateway->countAllLocations();
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
105037
protected function countTotalRows()
    {
        $source = $this->getSource();
        /** @var \Doctrine\ORM\Query\Expr\Select $select */
        $source->resetDQLPart('select')->setFirstResult(0)->select('count(' . $this->entityAlias . ')');
        return (int)$source->getQuery()->getSingleScalarResult();
    }
656129
public function getObjectsCount() : int
    {
        return $this->nb_language_list->getSize() +
               $this->nb_role_list->getSize() +
               $this->nb_site_list->getSize()
        ;
    }
468481
private function findNodesWithoutParents()
    {
        // get nodes that have no parent but depth > 0
        $qb = $this->accountRepository->createQueryBuilder('c2')
            ->select('count(c2.id)')
            ->leftJoin('c2.parent', 'c1')
            ->where('c2.depth <> 0 AND c2.parent IS NULL');

        return $qb->getQuery()->getSingleScalarResult();
    }
1305561
protected function _getLocationData()
    {
        if (self::LOCATION_TYPE_LATLON === $this->_locationType) { // Latitude/longitude
            $location = [];

            if (isset($this->_latitude)) { // Latitude
                $location['lat'] = $this->_latitude;
            } else {
                throw new InvalidException('Latitude has to be set');
            }

            if (isset($this->_longitude)) { // Geohash
                $location['lon'] = $this->_longitude;
            } else {
                throw new InvalidException('Longitude has to be set');
            }
        } elseif (self::LOCATION_TYPE_GEOHASH === $this->_locationType) { // Geohash
            $location = $this->_geohash;
        } else { // Invalid location type
            throw new InvalidException('Invalid location type');
        }

        return $location;
    }
408371
public function getNumChildren()
    {
        $db = Loader::db();
        $q = 'select count(*) as total from CollectionVersionBlocks where bID = ? and isOriginal = 0';
        $total = $db->getOne($q, [$this->getBlockID()]);

        return $total;
    }
166455
public function getSwapTotal()
    {
        if (count($this->_swapDevices) > 0) {
            $total = 0;
            foreach ($this->_swapDevices as $dev) {
                $total += $dev->getTotal();
            }

            return $total;
        } else {
            return null;
        }
    }
1355043
public function getTotalIndividuals() {
	    if(!$this->is_setup) return 0;
	    return Database::prepare(
	        'SELECT COUNT(*) FROM `##individuals`' .
	        ' WHERE i_file = :tree_id')
	        ->execute(array('tree_id' => $this->tree->getTreeId()))
	        ->fetchOne() ?: 0;
	}
276487
public function ignoredLocations()
    {
        if (is_null($this->ignoredLocationRequests)) {
            $this->ignoredLocationRequests = new IgnoredLocationRequests($this->client);
        }

        return $this->ignoredLocationRequests;
    }
506829
public int getPathCount() {
    int result = 0;
    for(IndexTreePath<E> path = this; path != null; path = path.parentPath) {
      result++;
    }
    return result;
  }
794661
public function getSiblingNode()
    {
        if ($this->siblingDomAddress === null) {
            return null;
        }

        if ($this->cachedSiblingNode === null) {
            $this->cachedSiblingNode = $this->nodeService->getNodeFromContextPath(
                $this->siblingDomAddress->getContextPath()
            );
        }

        return $this->cachedSiblingNode;
    }
737689
public function id(): int
    {
        return app('cache.array')->rememberForever(__CLASS__ . __METHOD__ . $this->place_name, function (): int {
            // The "top-level" place won't exist in the database.
            if ($this->parts->isEmpty()) {
                return 0;
            }

            $parent_place_id = $this->parent()->id();

            $place_id = (int) DB::table('places')
                ->where('p_file', '=', $this->tree->id())
                ->where('p_place', '=', $this->parts->first())
                ->where('p_parent_id', '=', $parent_place_id)
                ->value('p_id');

            if ($place_id === 0) {
                $place = $this->parts->first();

                DB::table('places')->insert([
                    'p_file'        => $this->tree->id(),
                    'p_place'       => $place,
                    'p_parent_id'   => $parent_place_id,
                    'p_std_soundex' => Soundex::russell($place),
                    'p_dm_soundex'  => Soundex::daitchMokotoff($place),
                ]);

                $place_id = (int) DB::connection()->getPdo()->lastInsertId();
            }

            return $place_id;
        });
    }
57647
private function countSubitems(Location $parentLocation): int
    {
        $searchQuery = $this->getSearchQuery($parentLocation);

        $searchQuery->limit = 0;
        $searchQuery->offset = 0;
        $searchQuery->performCount = true;

        return $this->searchService->findLocations($searchQuery)->totalCount;
    }
1316857
public function GetEnabledLocations() {
      $Data = $this->SQL
         ->Select('Application,Controller,Method')
         ->From('Message')
         ->Where('Enabled', '1')
         ->GroupBy('Application,Controller,Method')
         ->Get();
         
      $Locations = array();
      foreach ($Data as $Row) {
         if (in_array($Row->Controller, $this->_SpecialLocations)) {
            $Locations[] = $Row->Controller;
         } else {
            $Location = $Row->Application;
            if ($Row->Controller != '') $Location .= '/' . $Row->Controller;
            if ($Row->Method != '') $Location .= '/' . $Row->Method;
            $Locations[] = $Location;
         }
      }
      return $Locations;
   }
488643
public function getLastPoint()
    {
        if (empty($this->points)) {
            return null;
        }
        return $this->points[count($this->points) - 1];
    }
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;
  }
853432
public function getLocations()
	{
		if(!is_array($this->locations) || count($this->locations) < 1)
		{
			$this->getEntities();
		}
		return $this->locations;
	}