src/Budkit/Datastore/Activerecord.php
final public function count($table = '', $resetselect = true)
    {

        if (!empty($table)) {
            $this->traceTableAlias($table);
            $this->fromTable($table);
        }
        $sql = $this->compile($this->_countString . $this->identifiers('totalcount'), true);
        $statement = $this->DBO->prepare($sql);

        $results = $statement->execute();

        if ($resetselect) $this->resetSelect();
        if ($results->rowCount() == 0) return '0';

        $row = $results->fetchObject();

        return $row->totalcount;
    }
final public function count($table = '', $resetselect = true)
    {

        if (!empty($table)) {
            $this->traceTableAlias($table);
            $this->fromTable($table);
        }
        $sql = $this->compile($this->_countString . $this->identifiers('totalcount'), true);
        $statement = $this->DBO->prepare($sql);

        $results = $statement->execute();

        if ($resetselect) $this->resetSelect();
        if ($results->rowCount() == 0) return '0';

        $row = $results->fetchObject();

        return $row->totalcount;
    }
final public function count ( $ table = '' , $ resetselect = true ) { if ( ! empty ( $ table ) ) { $ this -> traceTableAlias ( $ table ) ; $ this -> fromTable ( $ table ) ; } $ sql = $ this -> compile ( $ this -> _countString . $ this -> identifiers ( 'totalcount' ) , true ) ; $ statement = $ this -> DBO -> prepare ( $ sql ) ; $ results = $ statement -> execute ( ) ; if ( $ resetselect ) $ this -> resetSelect ( ) ; if ( $ results -> rowCount ( ) == 0 ) return '0' ; $ row = $ results -> fetchObject ( ) ; return $ row -> totalcount ; }
Counts all the records in the specified table
Or records which satisfy the compiled SQL statement

@param string $table
@return interger
Counts all the records in the specified table Or records which satisfy the compiled SQL statement