public function count($idSite, $startDate, $endDate)
    {
        $this->checkIdSiteIsLoaded($idSite);

        // search includes end date, and count should not, so subtract one from the timestamp
        $annotations = $this->search($startDate, Date::factory($endDate->getTimestamp() - 1));

        // count the annotations
        $count = $starred = 0;
        if (!empty($annotations[$idSite])) {
            $count = count($annotations[$idSite]);
            foreach ($annotations[$idSite] as $annotation) {
                if ($annotation['starred']) {
                    ++$starred;
                }
            }
        }

        return array('count' => $count, 'starred' => $starred);
    }
public function count($idSite, $startDate, $endDate)
    {
        $this->checkIdSiteIsLoaded($idSite);

        // search includes end date, and count should not, so subtract one from the timestamp
        $annotations = $this->search($startDate, Date::factory($endDate->getTimestamp() - 1));

        // count the annotations
        $count = $starred = 0;
        if (!empty($annotations[$idSite])) {
            $count = count($annotations[$idSite]);
            foreach ($annotations[$idSite] as $annotation) {
                if ($annotation['starred']) {
                    ++$starred;
                }
            }
        }

        return array('count' => $count, 'starred' => $starred);
    }
public function count ( $ idSite , $ startDate , $ endDate ) { $ this -> checkIdSiteIsLoaded ( $ idSite ) ; // search includes end date, and count should not, so subtract one from the timestamp $ annotations = $ this -> search ( $ startDate , Date :: factory ( $ endDate -> getTimestamp ( ) - 1 ) ) ; // count the annotations $ count = $ starred = 0 ; if ( ! empty ( $ annotations [ $ idSite ] ) ) { $ count = count ( $ annotations [ $ idSite ] ) ; foreach ( $ annotations [ $ idSite ] as $ annotation ) { if ( $ annotation [ 'starred' ] ) { ++ $ starred ; } } } return array ( 'count' => $ count , 'starred' => $ starred ) ; }
Counts annotations & starred annotations within a date range and returns
the counts. The date range includes the start date, but not the end date.

@param int $idSite The ID of the site to count annotations for.
@param string|false $startDate The start date of the range or false if no
range check is desired.
@param string|false $endDate The end date of the range or false if no
range check is desired.
@return array eg, array('count' => 5, 'starred' => 2)
Counts annotations & starred annotations within a date range and returns the counts . The date range includes the start date but not the end date .