public function setCountMethod(int $method): int
    {
        if (! in_array($method, [self::COUNT_METHOD_SELECT, self::COUNT_METHOD_RECORDCOUNT])) {
            throw new \InvalidArgumentException('Invalid count method');
        }
        $previous = $this->countMethod;
        $this->countMethod = $method;
        return $previous;
    }
public function setCountMethod(int $method): int
    {
        if (! in_array($method, [self::COUNT_METHOD_SELECT, self::COUNT_METHOD_RECORDCOUNT])) {
            throw new \InvalidArgumentException('Invalid count method');
        }
        $previous = $this->countMethod;
        $this->countMethod = $method;
        return $previous;
    }
public function setCountMethod ( int $ method ) : int { if ( ! in_array ( $ method , [ self :: COUNT_METHOD_SELECT , self :: COUNT_METHOD_RECORDCOUNT ] ) ) { throw new \ InvalidArgumentException ( 'Invalid count method' ) ; } $ previous = $ this -> countMethod ; $ this -> countMethod = $ method ; return $ previous ; }
Change the count method, the only possible values are
COUNT_METHOD_SELECT and COUNT_METHOD_RECORDCOUNT
Return the previous count method set
@param int $method
@return int
Change the count method the only possible values are COUNT_METHOD_SELECT and COUNT_METHOD_RECORDCOUNT Return the previous count method set