public function setSingleType($singleType)
    {
        $allowedTypes = [
            self::SINGLE_TYPE_EXACT,
            self::SINGLE_TYPE_GREATER,
            self::SINGLE_TYPE_GREATER_OR_EQUAL,
            self::SINGLE_TYPE_LESS,
            self::SINGLE_TYPE_LESS_OR_EQUAL,
        ];

        if (!is_string($singleType) || !in_array($singleType, $allowedTypes, true)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid "single type" argument. Allowed types: [%s].', implode(', ', $allowedTypes)
            ));
        }

        $this->singleType = $singleType;

        return $this;
    }
public function setSingleType($singleType)
    {
        $allowedTypes = [
            self::SINGLE_TYPE_EXACT,
            self::SINGLE_TYPE_GREATER,
            self::SINGLE_TYPE_GREATER_OR_EQUAL,
            self::SINGLE_TYPE_LESS,
            self::SINGLE_TYPE_LESS_OR_EQUAL,
        ];

        if (!is_string($singleType) || !in_array($singleType, $allowedTypes, true)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid "single type" argument. Allowed types: [%s].', implode(', ', $allowedTypes)
            ));
        }

        $this->singleType = $singleType;

        return $this;
    }
public function setSingleType ( $ singleType ) { $ allowedTypes = [ self :: SINGLE_TYPE_EXACT , self :: SINGLE_TYPE_GREATER , self :: SINGLE_TYPE_GREATER_OR_EQUAL , self :: SINGLE_TYPE_LESS , self :: SINGLE_TYPE_LESS_OR_EQUAL , ] ; if ( ! is_string ( $ singleType ) || ! in_array ( $ singleType , $ allowedTypes , true ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid "single type" argument. Allowed types: [%s].' , implode ( ', ' , $ allowedTypes ) ) ) ; } $ this -> singleType = $ singleType ; return $ this ; }
Sets type for the filter treated as single.

@param string $singleType AbstractRangeOrSingleFilter::SINGLE_TYPE_*

@return static
@throws InvalidArgumentException On invalid argument
Sets type for the filter treated as single .