public function count($load = true)
    {
        //if query is set, and the data is not loaded
        //lets use the query to get the count
        if (isset($this->_query) && !$this->isLoaded() && !$load) {
            $query = AnDomainQuery::getInstance($this->getRepository(), $this->_query);

            return $query->fetchValue('count(*)');
        } else {
            $this->_loadData();
            $result = parent::count();
        }

        return $result;
    }
public function count($load = true)
    {
        //if query is set, and the data is not loaded
        //lets use the query to get the count
        if (isset($this->_query) && !$this->isLoaded() && !$load) {
            $query = AnDomainQuery::getInstance($this->getRepository(), $this->_query);

            return $query->fetchValue('count(*)');
        } else {
            $this->_loadData();
            $result = parent::count();
        }

        return $result;
    }
public function count ( $ load = true ) { //if query is set, and the data is not loaded //lets use the query to get the count if ( isset ( $ this -> _query ) && ! $ this -> isLoaded ( ) && ! $ load ) { $ query = AnDomainQuery :: getInstance ( $ this -> getRepository ( ) , $ this -> _query ) ; return $ query -> fetchValue ( 'count(*)' ) ; } else { $ this -> _loadData ( ) ; $ result = parent :: count ( ) ; } return $ result ; }
Count Data.

@param booelan $load If the flag is set to on. If the qurey is set, it will
perform a count query instead of loading all the objects

@return int
Count Data .