]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/YammerImport/classes/Yammer_state.php
Fix mising require_once (now required here because of rearranging)
[quix0rs-gnu-social.git] / plugins / YammerImport / classes / Yammer_state.php
index 0174ead15dc56f139867ccc7c51b626b2495300e..88bd693bfd53362ba6b47fb14412cb18d863e9ae 100644 (file)
@@ -36,7 +36,7 @@ class Yammer_state extends Memcached_DataObject
     public $__table = 'yammer_state'; // table name
     public $id;                       // int  primary_key not_null
     public $state;                    // import state key
-    public $request_token;            // oauth request token; clear when auth is complete.
+    public $last_error;               // text of last-encountered error, if any
     public $oauth_token;              // actual oauth token! clear when import is done?
     public $oauth_secret;             // actual oauth secret! clear when import is done?
     public $users_page;               // last page of users we've fetched
@@ -46,6 +46,23 @@ class Yammer_state extends Memcached_DataObject
     public $created;                  // datetime
     public $modified;                 // datetime
 
+    /**
+     * Get an instance by key
+     *
+     * This is a utility method to get a single instance with a given key value.
+     *
+     * @param string $k Key to use to lookup
+     * @param mixed  $v Value to lookup
+     *
+     * @return Yammer_state object found, or null for no hits
+     *
+     */
+
+    function staticGet($k, $v=null)
+    {
+        return Memcached_DataObject::staticGet('Yammer_state', $k, $v);
+    }
+
     /**
      * Return schema definition to set this table up in onCheckSchema
      */
@@ -54,7 +71,7 @@ class Yammer_state extends Memcached_DataObject
         return array(new ColumnDef('id', 'int', null,
                                    false, 'PRI'),
                      new ColumnDef('state', 'text'),
-                     new ColumnDef('request_token', 'text'),
+                     new ColumnDef('last_error', 'text'),
                      new ColumnDef('oauth_token', 'text'),
                      new ColumnDef('oauth_secret', 'text'),
                      new ColumnDef('users_page', 'int'),
@@ -78,7 +95,7 @@ class Yammer_state extends Memcached_DataObject
     {
         return array('id'              => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
                      'state'           => DB_DATAOBJECT_STR,
-                     'request_token'   => DB_DATAOBJECT_STR,
+                     'last_error'      => DB_DATAOBJECT_STR,
                      'oauth_token'     => DB_DATAOBJECT_STR,
                      'oauth_secret'    => DB_DATAOBJECT_STR,
                      'users_page'      => DB_DATAOBJECT_INT,