Example #1
0
 public static function add(GatheringDataSourceConfiguration $configuration, $post)
 {
     $gathering = $configuration->getGatheringObject();
     try {
         // we wrap this in a try because it MIGHT fail if it's a duplicate
         $item = parent::add($gathering, $configuration->getGatheringDataSourceObject(), $post->get_date('Y-m-d H:i:s'), $post->get_title(), $post->get_link());
     } catch (Exception $e) {
     }
     if (is_object($item)) {
         $item->assignFeatureAssignments($post);
         $item->setAutomaticGatheringItemTemplate();
         return $item;
     }
 }
Example #2
0
 public static function add(GatheringDataSourceConfiguration $configuration, $tweet)
 {
     $gathering = $configuration->getGatheringObject();
     try {
         // we wrap this in a try because it MIGHT fail if it's a duplicate
         $item = parent::add($gathering, $configuration->getGatheringDataSourceObject(), date('Y-m-d H:i:s', strtotime($tweet->created_at)), $tweet->text, $tweet->id);
     } catch (Exception $e) {
     }
     if (is_object($item)) {
         $item->assignFeatureAssignments($tweet);
         if (count($tweet->entities->media) > 0 && $tweet->entities->media[0]->type == 'photo') {
             $item->setAutomaticGatheringItemTemplate();
         } else {
             $type = GatheringItemTemplateType::getByHandle('tile');
             $template = GatheringItemTemplate::getByHandle('tweet');
             $item->setGatheringItemTemplate($type, $template);
         }
         return $item;
     }
 }
Example #3
0
 public function delete()
 {
     parent::delete();
     $db = Loader::db();
     $db->Execute('delete from gaPage where gaiID = ?', array($this->getGatheringItemID()));
 }
Example #4
0
 public function delete()
 {
     parent::delete();
     $db = Database::connection();
     $db->executeQuery('delete from gaPage where gaiID = ?', array($this->getGatheringItemID()));
 }