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); } }
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; }
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]]; }
protected function findActionCount($params) { return NEWSFEED_BOL_ActionDao::getInstance()->findCountByFeed($params['feedType'], $params['feedId'], $params['startTime'], $params['formats']); }
private function __construct() { $this->actionDao = NEWSFEED_BOL_ActionDao::getInstance(); $this->actionFeedDao = NEWSFEED_BOL_ActionFeedDao::getInstance(); $this->followDao = NEWSFEED_BOL_FollowDao::getInstance(); $this->likeDao = NEWSFEED_BOL_LikeDao::getInstance(); $this->statusDao = NEWSFEED_BOL_StatusDao::getInstance(); $this->activityDao = NEWSFEED_BOL_ActivityDao::getInstance(); $this->cronCommandDao = NEWSFEED_BOL_CronCommandDao::getInstance(); $this->actionSetDao = NEWSFEED_BOL_ActionSetDao::getInstance(); }
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) . ' )'); }