Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * 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;
 }
Example #3
0
 /**
  * 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;
 }