Horde_Registry::_doHasSearch PHP Method

_doHasSearch() protected method

Do the has*() search.
See also: hasMethod
See also: hasLink
protected _doHasSearch ( $method, $app, string $func ) : mixed
$func string The API function to call to get the list of elements to search. Either 'methods' or 'links'.
return mixed The application implementing $method, false if it doesn't exist;
    protected function _doHasSearch($method, $app, $func)
    {
        if (is_null($app)) {
            if (($lookup = $this->_methodLookup($method)) === false) {
                return false;
            }
            list($app, $call) = $lookup;
        } else {
            $call = $method;
        }
        if ($api_ob = $this->_loadApi($app)) {
            switch ($func) {
                case 'links':
                    $links = $api_ob->links();
                    return isset($links[$call]) ? $app : false;
                case 'methods':
                    return in_array($call, $api_ob->methods()) ? $app : false;
            }
        }
        return false;
    }