public function count($field='*')
    {
        $this->getQuery()->type('select')->remove('fields')->set('count', $field);
        
        $result = $this->query();
        
        if ($result) {// get first row's value
            $result = current($result[0]);
        } else {
            $result = 0;
        }
        
        return $result;
    }
public function count($field='*')
    {
        $this->getQuery()->type('select')->remove('fields')->set('count', $field);
        
        $result = $this->query();
        
        if ($result) {// get first row's value
            $result = current($result[0]);
        } else {
            $result = 0;
        }
        
        return $result;
    }
public function count ( $ field = '*' ) { $ this -> getQuery ( ) -> type ( 'select' ) -> remove ( 'fields' ) -> set ( 'count' , $ field ) ; $ result = $ this -> query ( ) ; if ( $ result ) { // get first row's value $ result = current ( $ result [ 0 ] ) ; } else { $ result = 0 ; } return $ result ; }
get rows num
@param  string count field
@return int
get rows num