src/Charcoal/Source/Filter.php
public function setFunc($func)
    {
        if ($func === null) {
            $this->func = $func;
            return $this;
        }

        if (!is_string($func)) {
            throw new InvalidArgumentException(
                'Function name should be a string.'
            );
        }

        $func = strtoupper($func);
        if (!in_array($func, $this->validFunc())) {
            throw new InvalidArgumentException(sprintf(
                'Function "%s" not allowed in this context.',
                $func
            ));
        }

        $this->func = $func;
        return $this;
    }
public function setFunc($func)
    {
        if ($func === null) {
            $this->func = $func;
            return $this;
        }

        if (!is_string($func)) {
            throw new InvalidArgumentException(
                'Function name should be a string.'
            );
        }

        $func = strtoupper($func);
        if (!in_array($func, $this->validFunc())) {
            throw new InvalidArgumentException(sprintf(
                'Function "%s" not allowed in this context.',
                $func
            ));
        }

        $this->func = $func;
        return $this;
    }
public function setFunc ( $ func ) { if ( $ func === null ) { $ this -> func = $ func ; return $ this ; } if ( ! is_string ( $ func ) ) { throw new InvalidArgumentException ( 'Function name should be a string.' ) ; } $ func = strtoupper ( $ func ) ; if ( ! in_array ( $ func , $ this -> validFunc ( ) ) ) { throw new InvalidArgumentException ( sprintf ( 'Function "%s" not allowed in this context.' , $ func ) ) ; } $ this -> func = $ func ; return $ this ; }
Set the function to be called on the expression.

@param  string $func The function name to invoke on the field.
@throws InvalidArgumentException If the parameter is not a valid function.
@return self
Set the function to be called on the expression .