Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 2
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 3
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->friendslistQuery = FriendQuery::getFriendListQuery();
     $this->eventslistQuery = EventsQuery::getEventsListQuery();
 }
Exemplo n.º 4
0
 /**
  * @param array $data
  * @return mixed
  */
 public function insert(array $data)
 {
     $conversation = new Conversations();
     $conversation->markAsUnRead($data['conversation']);
     return parent::insert($data);
 }
Exemplo n.º 5
0
 /**
  *
  */
 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));
 }