/** * Fetch customer key by id * @param string $key */ public static function fetchKey($key) { if (isset(self::$keys_cache[$key])) { return self::$keys_cache[$key]; } $k = new self(); if ($k->getByKey($key)) { self::$keys_cache[$key] = $k; return $k; } return false; }
/** * Fetch customer key by id * @param string $key * @return OAuthKey|false */ public static function fetchKey($key) { if (isset(self::$keys_cache[$key])) { return self::$keys_cache[$key]; } $k = new self(); if ($k->getByKey($key)) { self::$keys_cache[$key] = $k; BeanFactory::registerBean("OAuthKeys", $k); return $k; } return false; }
/** * Fetch customer key by id * @param string $key * @param string $oauth_type Either "oauth1" or "oauth2", defaults to "oauth1" * @return OAuthKey|false */ public static function fetchKey($key, $oauth_type = "oauth1") { if (isset(self::$keys_cache[$key]) && self::$keys_cache[$key]->oauth_type == $oauth_type) { return self::$keys_cache[$key]; } $k = new self(); if ($k->getByKey($key, $oauth_type)) { self::$keys_cache[$key] = $k; BeanFactory::registerBean($k); return $k; } return false; }