Example #1
0
 /**
  * Count the number of Yammer notices we've pulled down for pending import...
  *
  * @return int
  */
 public function countFetchedNotices()
 {
     $map = new Yammer_notice_stub();
     return $map->count();
 }
Example #2
0
 /**
  * Save the native Yammer API representation of a message for the pending
  * import. Since they come in in reverse chronological order, we need to
  * record them all as stubs and then go through from the beginning and
  * save them as native notices, or we'll lose ordering and threading
  * data.
  *
  * @param integer $orig_id ID of the notice on Yammer
  * @param array $data the message record fetched out of Yammer API returnd data
  *
  * @return Yammer_notice_stub new object for this value
  */
 static function record($orig_id, $data)
 {
     common_debug("Recording Yammer message stub {$orig_id} for pending import...");
     $stub = new Yammer_notice_stub();
     $stub->id = $orig_id;
     $stub->json_data = json_encode($data);
     $stub->created = common_sql_now();
     $stub->insert();
     return $stub;
 }