Exemplo n.º 1
0
 public function insertQueue(bdSocialShare_Shareable_Abstract $shareable, array $targets, $default, array $viewingUser = null, array $options = array())
 {
     $shareableRecoveryData = $shareable->getRecoveryData();
     if (empty($shareableRecoveryData)) {
         return false;
     }
     $options = array_merge(array('queueDate' => 0), $options);
     $this->standardizeViewingUserReference($viewingUser);
     $queueDate = $options['queueDate'];
     if (empty($queueDate)) {
         $queueDate = $shareable->getQueueDate($this);
     }
     if (empty($queueDate)) {
         $queueDate = XenForo_Application::$time;
     }
     if (is_callable(array('XenForo_Application', 'defer'))) {
         XenForo_Application::defer('bdSocialShare_Deferred_ShareQueue', array(), 'bdSocialShare_ShareQueue', false, $queueDate + 1);
     }
     $this->_getDb()->insert('xf_bdsocialshare_share_queue', array('queue_data' => serialize(array('shareable' => $shareableRecoveryData, 'targets' => $targets, 'default' => $default, 'user_id' => $viewingUser['user_id'])), 'queue_date' => $queueDate));
     return true;
 }