public function count($field = '')
    {
        if ($field === '') {
            $query = [];
        } else {
            $query = (array) $field;
        }
        return count($this->select($query));
    }
public function count($field = '')
    {
        if ($field === '') {
            $query = [];
        } else {
            $query = (array) $field;
        }
        return count($this->select($query));
    }
public function count ( $ field = '' ) { if ( $ field === '' ) { $ query = [ ] ; } else { $ query = ( array ) $ field ; } return count ( $ this -> select ( $ query ) ) ; }
Counts the number of items per field or for all fields.

@param string $field the field name to count (empty for all fields)
@return int          the number of rows containing that field
Counts the number of items per field or for all fields .