public function fields($fields)
    {
        if (!is_string($fields)) {
            throw new FatalException('Only strings are allowed in COUNT query');
        }

        $this->fields = sprintf(
            'COUNT(%s)',
            DatabaseConnectionFactory::get()->quoteIdentifier($fields)
        );

        return $this;
    }
public function fields($fields)
    {
        if (!is_string($fields)) {
            throw new FatalException('Only strings are allowed in COUNT query');
        }

        $this->fields = sprintf(
            'COUNT(%s)',
            DatabaseConnectionFactory::get()->quoteIdentifier($fields)
        );

        return $this;
    }
public function fields ( $ fields ) { if ( ! is_string ( $ fields ) ) { throw new FatalException ( 'Only strings are allowed in COUNT query' ) ; } $ this -> fields = sprintf ( 'COUNT(%s)' , DatabaseConnectionFactory :: get ( ) -> quoteIdentifier ( $ fields ) ) ; return $ this ; }
Set the field to count.
@param $fields
@return $this
@throws FatalException
Set the field to count .