예제 #1
0
 public function markExpiredForDelete()
 {
     $expirationPeriod = 3600 * 24 * 31 * 3;
     // Once in three month
     $expiredActionIds = $this->actionDao->findExpiredIdList($expirationPeriod);
     $this->markForDelete($expiredActionIds);
 }
예제 #2
0
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return NEWSFEED_BOL_ActionDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
예제 #3
0
파일: upgrade.php 프로젝트: vazahat/dudex
 private function copyFeed()
 {
     if (OW::getPluginManager()->isPluginActive('newsfeed')) {
         $tbl = NEWSFEED_BOL_ActionDao::getInstance()->getTableName();
         $query = 'UPDATE ' . $tbl . ' SET pluginKey="equestions" WHERE pluginKey="questions"';
         OW::getDbo()->query($query);
     }
 }
예제 #4
0
파일: feed_dao.php 프로젝트: vazahat/dudex
 public function isDuplicateFeed($groupId, $content)
 {
     $actionDao = NEWSFEED_BOL_ActionDao::getInstance();
     $groupUrl = OW::getRouter()->urlForRoute('groups-view', array('groupId' => $groupId));
     $query = "SELECT data FROM " . $actionDao->getTableName() . "\n                  WHERE data LIKE '%" . $groupId . "\"}}'             \n                    AND entityType = 'groups-status'\n                    AND pluginKey = 'newsfeed'";
     $datas = $this->dbo->queryForList($query);
     foreach ($datas as $data) {
         if ($content == json_decode($data['data'])->string) {
             return true;
         }
     }
     return false;
 }
예제 #5
0
 public function getAction($entityType, $entityId)
 {
     $actionKey = $entityType . ':' . $entityId;
     if (empty($this->actionIdList[$actionKey])) {
         $action = NEWSFEED_BOL_ActionDao::getInstance()->findAction($entityType, $entityId);
         if ($action === null) {
             return null;
         }
         $activityList = $this->findActivityList($this->params, array($action->id));
         $action = $this->makeAction($action, $activityList);
         if ($action === null) {
             return null;
         }
         $this->actionList[$action->getId()] = $action;
         $this->actionIdList[$actionKey] = $action->getId();
     }
     return $this->actionList[$this->actionIdList[$actionKey]];
 }
예제 #6
0
 protected function findActionCount($params)
 {
     return NEWSFEED_BOL_ActionDao::getInstance()->findCountByFeed($params['feedType'], $params['feedId'], $params['startTime'], $params['formats']);
 }
예제 #7
0
 private function getQueryParts($conts)
 {
     $actionDao = NEWSFEED_BOL_ActionDao::getInstance();
     $or = array();
     $join = '';
     foreach ($conts as $cond) {
         $action = array_filter($cond['action']);
         $activity = array_filter($cond['activity']);
         $where = array();
         if (empty($activity['id'])) {
             if (!empty($action['id'])) {
                 $activity['actionId'] = $action['id'];
             } else {
                 if (!empty($action)) {
                     $join = 'INNER JOIN ' . $actionDao->getTableName() . ' action ON activity.actionId=action.id';
                     foreach ($action as $k => $v) {
                         $where[] = 'action.' . $k . "='" . $this->dbo->escapeString($v) . "'";
                     }
                 }
             }
         }
         foreach ($activity as $k => $v) {
             $where[] = 'activity.' . $k . "='" . $this->dbo->escapeString($v) . "'";
         }
         $or[] = implode(' AND ', $where);
     }
     return array('join' => $join, 'where' => empty($or) ? '1' : '( ' . implode(' ) OR ( ', $or) . ' )');
 }