summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/Oauth_application.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/classes/Oauth_application.php b/classes/Oauth_application.php
index d4de6d82e..5df8b9459 100644
--- a/classes/Oauth_application.php
+++ b/classes/Oauth_application.php
@@ -88,4 +88,18 @@ class Oauth_application extends Memcached_DataObject
return $this->update($orig);
}
+ static function getByConsumerKey($key)
+ {
+ if (empty($key)) {
+ return null;
+ }
+
+ $app = new Oauth_application();
+ $app->consumer_key = $key;
+ $app->limit(1);
+ $result = $app->find(true);
+
+ return empty($result) ? null : $app;
+ }
+
}