Get the number of queued widgets.

@param string $location Location (e.g. 'dashboard_aside_top')
@param string $zone     Either Zone::FRONTEND or Zone::BACKEND

@return int
979519
public function count($location, $zone = Zone::FRONTEND)
    {
        $count = 0;

        foreach ($this->queue as $widget) {
            if ($widget->getZone() === $zone && $widget->getLocation() === $location) {
                ++$count;
            }
        }

        return $count;
    }
1168860
protected function searchSubGroups(Location $location, $offset = 0, $limit = 25)
    {
        $searchQuery = new LocationQuery();

        $searchQuery->offset = $offset;
        $searchQuery->limit = $limit;

        $searchQuery->filter = new CriterionLogicalAnd([
            new CriterionContentTypeId($this->settings['userGroupClassID']),
            new CriterionParentLocationId($location->id),
        ]);

        $searchQuery->sortClauses = $location->getSortClauses();

        return $this->repository->getSearchService()->findLocations($searchQuery, array(), false);
    }
1224876
public function getZone( $index )
    {
        $zone = null;

        if( isset( $this->attributes['zones'][$index] ) )
            $zone = $this->attributes['zones'][$index];

        return $zone;
    }
1215192
public function fetchCount($where=array()) {
        $obj = $this->getConnection();
        if (empty($where) == false) {
            foreach ($where as $key => $value) {
                $obj->where($key, $value);
            }
        }
        $count = $obj->getValue($this->getDao()->getTableName(), 'count(1)');
        return (int)$count;
	}
1076966
public function has($location, $zone = Zone::FRONTEND)
    {
        return (bool) $this->count($location, $zone);
    }
1328971
public function listDiscounts($location_id)
    {
        list($response, $statusCode, $httpHeader) = $this->listDiscountsWithHttpInfo ($location_id);
        return $response; 
    }
500012
public int countOnes(int location) {

    int count = 0;
    for (int i = 0; i < populationSize; i++) {
      if (subregionIdx[location][i] == 1) {
        count++;
      }
    }

    return count;
  }
652882
public function getVolumeFeed($location = null)
    {
        if ($location == null) {
            $uri = self::VOLUME_FEED_URI;
        } else if ($location instanceof Zend_Gdata_Query) {
            $uri = $location->getQueryUrl();
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_Books_VolumeFeed');
    }
473902
public function findByLocation(Location $location, array $orderBy = [],
        ?int $limit = null): array
    {
        $qb = $this->createQueryBuilder('su');
        $this->filterByLocation($qb, $location);
        $this->addOrderBy($qb, $orderBy);
        $this->addLimit($qb, $limit);

        return $qb->getQuery()->getResult();
    }
943551
private function visitLinkedZone(Zone $zone): ?array
    {
        $linkedZone = $zone->getLinkedZone();

        if (!$linkedZone instanceof Zone) {
            return null;
        }

        return [
            'identifier' => $linkedZone->getIdentifier(),
            'layout_id' => $linkedZone->getLayoutId(),
        ];
    }
414962
public static function get_widget_count($sidebar_id)
    {
        global $_wp_sidebars_widgets;

        // If not front page, the global is empty so set it another way.
        if (empty($_wp_sidebars_widgets)) {
            $_wp_sidebars_widgets = \get_option('sidebars_widgets', []);
        }

        // if our sidebar exists, return count.
        if (isset($_wp_sidebars_widgets[ $sidebar_id ])) {
            return \count($_wp_sidebars_widgets[ $sidebar_id ]);
        }

        return 0;
    }
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;
    }
323614
public function getCellFeed($location)
    {
        if ($location instanceof Zend_Gdata_Spreadsheets_CellQuery) {
            $uri = $location->getQueryUrl();
        } else if ($location instanceof Zend_Gdata_Spreadsheets_WorksheetEntry) {
            $uri = $location->getLink(self::CELL_FEED_LINK_URI)->href;
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_Spreadsheets_CellFeed');
    }
1071996
public function coreHeartbeat($location)
    {
        add_action('init', function () use ($location) {
            if ('all' === $location) {
                wp_deregister_script('heartbeat');
            } else if (OL_ZEUS_ISADMIN) {
                global $pagenow;

                if (('admin' === $location && 'post.php' !== $pagenow && 'post-new.php' !== $pagenow) ||
                    ('dashboard' === $location && 'index.php' === $pagenow)
                ) {
                    wp_deregister_script('heartbeat');
                }
            }
        }, 1);
    }
482051
public function count(string $identifier = ''): int
    {
        if ($identifier) {
            return $this->countItems($identifier);
        }

        $menus   = $this->all();
        $counter = 0;

        foreach ($menus as $identifier => $menu) {
            $counter += $this->countItems($identifier);
        }

        return $counter;
    }
1189322
protected function _getLocationTimestamp($location)
    {
        $cacheKey = 'mmi-head-ts-' . md5($location);
        $cache = $this->view->getCache();
        if (null !== $cache && (null !== ($ts = $cache->load($cacheKey)))) {
            return $ts;
        }
        //obliczanie timestampu
        $ts = file_exists($path = BASE_PATH . '/web' . $location) ? filemtime($path) : 0;
        if (null !== $cache) {
            $cache->save($ts, $cacheKey, 0);
        }
        return $ts;
    }
865822
public function getUserEntry($location)
    {
        if ($location === null) {
            require_once 'Zend/Gdata/App/InvalidArgumentException.php';
            throw new Zend_Gdata_App_InvalidArgumentException(
                    'Location must not be null');
        } else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
            $location->setType('entry');
            $uri = $location->getQueryUrl();
        } else if ($location instanceof Zend_Gdata_Query) {
            $uri = $location->getQueryUrl();
        } else {
            $uri = $location;
        }
        return parent::getEntry($uri, 'Zend_Gdata_Photos_UserEntry');
    }