Ejemplo n.º 1
0
 private function copyData()
 {
     $tables = array(array(QUESTIONS_BOL_QuestionDao::getInstance()->getTableName(), EQUESTIONS_BOL_QuestionDao::getInstance()->getTableName(), array('id', 'userId', 'text', 'settings', 'timeStamp')), array(QUESTIONS_BOL_OptionDao::getInstance()->getTableName(), EQUESTIONS_BOL_OptionDao::getInstance()->getTableName(), array('id', 'userId', 'questionId', 'text', 'timeStamp')), array(QUESTIONS_BOL_AnswerDao::getInstance()->getTableName(), EQUESTIONS_BOL_AnswerDao::getInstance()->getTableName(), array('id', 'userId', 'optionId', 'timeStamp')), array(QUESTIONS_BOL_FollowDao::getInstance()->getTableName(), EQUESTIONS_BOL_FollowDao::getInstance()->getTableName(), array('id', 'userId', 'questionId', 'timeStamp')), array(QUESTIONS_BOL_ActivityDao::getInstance()->getTableName(), EQUESTIONS_BOL_ActivityDao::getInstance()->getTableName(), array('id', 'questionId', 'activityType', 'activityId', 'userId', 'timeStamp', 'privacy', 'data')));
     foreach ($tables as $t) {
         OW::getDbo()->query('REPLACE INTO ' . $t[1] . ' (`' . implode('` ,`', $t[2]) . '`) SELECT `' . implode('` ,`', $t[2]) . '` FROM ' . $t[0]);
     }
 }
Ejemplo n.º 2
0
 private function __construct()
 {
     $this->activityDao = EQUESTIONS_BOL_ActivityDao::getInstance();
     $this->questionDao = EQUESTIONS_BOL_QuestionDao::getInstance();
 }
Ejemplo n.º 3
0
 public function findNotificationsFeedCount($startStamp, $userId)
 {
     $activityDao = EQUESTIONS_BOL_ActivityDao::getInstance();
     $query = "SELECT COUNT(DISTINCT q.id) FROM " . $this->getTableName() . " q\n            INNER JOIN " . $activityDao->getTableName() . " a ON q.id=a.questionId\n            WHERE a.timeStamp <= :ss AND a.activityType=:aa AND a.activityId=:u";
     return $this->dbo->queryForColumn($query, array('u' => $userId, 'ss' => $startStamp, 'aa' => EQUESTIONS_BOL_FeedService::ACTIVITY_ASK));
 }