X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FYammerImport%2Fclasses%2FYammer_state.php;h=b0f0dfabf3fdbf06dd8ec012887f21d577beab5a;hb=e95f77d34c501d345e731ccf6bc722034d155b77;hp=2f1fd7780bc75a334357286ef9717bc2422dfe76;hpb=9a0027cab17d30750c4fbec4a1e009b67087dc9e;p=quix0rs-gnu-social.git diff --git a/plugins/YammerImport/classes/Yammer_state.php b/plugins/YammerImport/classes/Yammer_state.php index 2f1fd7780b..b0f0dfabf3 100644 --- a/plugins/YammerImport/classes/Yammer_state.php +++ b/plugins/YammerImport/classes/Yammer_state.php @@ -31,11 +31,12 @@ if (!defined('STATUSNET')) { exit(1); } -class Yammer_state extends Memcached_DataObject +class Yammer_state extends Managed_DataObject { public $__table = 'yammer_state'; // table name public $id; // int primary_key not_null public $state; // import state key + 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 @@ -45,23 +46,6 @@ 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 */ @@ -70,6 +54,7 @@ class Yammer_state extends Memcached_DataObject return array(new ColumnDef('id', 'int', null, false, 'PRI'), new ColumnDef('state', 'text'), + new ColumnDef('last_error', 'text'), new ColumnDef('oauth_token', 'text'), new ColumnDef('oauth_secret', 'text'), new ColumnDef('users_page', 'int'), @@ -88,11 +73,11 @@ class Yammer_state extends Memcached_DataObject * * @return array array of column definitions */ - function table() { return array('id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, 'state' => DB_DATAOBJECT_STR, + 'last_error' => DB_DATAOBJECT_STR, 'oauth_token' => DB_DATAOBJECT_STR, 'oauth_secret' => DB_DATAOBJECT_STR, 'users_page' => DB_DATAOBJECT_INT, @@ -111,7 +96,6 @@ class Yammer_state extends Memcached_DataObject * * @return array list of key field names */ - function keys() { return array_keys($this->keyTypes()); @@ -129,7 +113,6 @@ class Yammer_state extends Memcached_DataObject * 'K' for primary key: for compound keys, add an entry for each component; * 'U' for unique keys: compound keys are not well supported here. */ - function keyTypes() { return array('id' => 'K'); @@ -145,7 +128,6 @@ class Yammer_state extends Memcached_DataObject * * @return array magic three-false array that stops auto-incrementing. */ - function sequenceKey() { return array(false, false, false);