示例#1
0
 /**
  * @param array $data
  * @param String $where
  * @return int
  */
 public function update(array $data, $where)
 {
     foreach ($data as $key => $value) {
         $dataToStore = ['user_id' => $this->user->userid, 'profilefield_id' => $key, 'value' => $value];
         $query = $this->getAdapter()->select()->from(['p' => $this->getTableName()])->where('profilefield_id = ' . $key . ' AND user_id = ' . $this->user->userid);
         $result = $this->getAdapter()->fetchOne($query);
         if ($result === false) {
             $this->insert($dataToStore);
         } else {
             parent::update($dataToStore, 'profilefield_id = ' . $key . ' AND user_id = ' . $this->user->userid);
         }
     }
 }
示例#2
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct();
 }
示例#3
0
文件: Walls.php 项目: rcrrich/cunity
 /**
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->friendslistQuery = FriendQuery::getFriendListQuery();
     $this->eventslistQuery = EventsQuery::getEventsListQuery();
 }
示例#4
0
 /**
  * @param array $data
  * @return mixed
  */
 public function insert(array $data)
 {
     $conversation = new Conversations();
     $conversation->markAsUnRead($data['conversation']);
     return parent::insert($data);
 }
示例#5
0
文件: Posts.php 项目: rcrrich/cunity
 /**
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->friendslistQuery = new \Zend_Db_Expr($this->getAdapter()->select()->from($this->_dbprefix . "relations", new \Zend_Db_Expr("(CASE WHEN sender = " . $_SESSION['user']->userid . " THEN receiver WHEN receiver = " . $_SESSION['user']->userid . " THEN sender END)"))->where("status > 0")->where("sender=?", $_SESSION['user']->userid)->orWhere("receiver=?", $_SESSION['user']->userid));
 }