Horde_Registry::_loadApi PHP Method

_loadApi() protected method

Load an application's API object.
protected _loadApi ( string $app ) : Horde_Registry_Api
$app string The application to load.
return Horde_Registry_Api The API object, or null if not available.
    protected function _loadApi($app)
    {
        if (isset($this->_cache['ob'][$app]['api'])) {
            return $this->_cache['ob'][$app]['api'];
        }
        $api = null;
        $status = array('active', 'notoolbar', 'hidden');
        $status[] = $this->isAdmin() ? 'admin' : 'noadmin';
        if (in_array($this->applications[$app]['status'], $status)) {
            try {
                $api = $this->getApiInstance($app, 'api');
            } catch (Horde_Exception $e) {
                Horde::log($e, 'DEBUG');
            }
        }
        $this->_cache['ob'][$app]['api'] = $api;
        return $api;
    }