]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/YammerImport/classes/Yammer_notice_stub.php
NoticeListItem attentions showed double for User_group
[quix0rs-gnu-social.git] / plugins / YammerImport / classes / Yammer_notice_stub.php
index cc52554deace035745f38224120e890bd4f26e0c..e38d3164e3f6357dcec2af4379955cdb022d18cf 100644 (file)
@@ -40,8 +40,7 @@ if (!defined('STATUSNET')) {
  * down in reverse chronological order, then go back over them from oldest to
  * newest and actually save them into our notice table.
  */
-
-class Yammer_notice_stub extends Memcached_DataObject
+class Yammer_notice_stub extends Managed_DataObject
 {
     public $__table = 'yammer_notice_stub'; // table name
     public $id;                             // int  primary_key not_null
@@ -69,7 +68,6 @@ class Yammer_notice_stub extends Memcached_DataObject
      *
      * @return array array of column definitions
      */
-
     function table()
     {
         return array('id'           => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
@@ -104,7 +102,6 @@ class Yammer_notice_stub 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');
@@ -120,12 +117,21 @@ class Yammer_notice_stub extends Memcached_DataObject
      *
      * @return array magic three-false array that stops auto-incrementing.
      */
-
     function sequenceKey()
     {
         return array(false, false, false);
     }
 
+    /**
+     * Decode the stored data structure.
+     *
+     * @return mixed
+     */
+    public function getData()
+    {
+        return json_decode($this->json_data, true);
+    }
+
     /**
      * Save the native Yammer API representation of a message for the pending
      * import. Since they come in in reverse chronological order, we need to
@@ -153,22 +159,4 @@ class Yammer_notice_stub extends Memcached_DataObject
 
         return $stub;
     }
-
-    /**
-     * Save a mapping between a remote Yammer and local imported user.
-     *
-     * @param integer $user_id ID of the status in StatusNet
-     *
-     * @return Yammer_notice_stub new object for this value
-     */
-
-    static function retrieve($orig_id)
-    {
-        $stub = self::staticGet('id', $orig_id);
-        if ($stub) {
-            return json_decode($stub->json_data, true);
-        } else {
-            return false;
-        }
-    }
 }