DMS\Filter\Filters\Callback::useObjectMethod PHP Method

useObjectMethod() protected method

Filters by executing a method in the object
protected useObjectMethod ( string $method, mixed $value ) : mixed
$method string
$value mixed
return mixed
    protected function useObjectMethod($method, $value)
    {
        $currentObject = $this->getCurrentObject();
        if ($currentObject === null) {
            throw new FilterException("The target object was not provided to the filter, can't execute method. Please report this.");
        }
        if (!method_exists($currentObject, $method)) {
            throw new InvalidCallbackException(sprintf("CallbackFilter: Method '%s' not found in object of type '%s'", $method, get_class($currentObject)));
        }
        return $currentObject->{$method}($value);
    }