/**
  * Gets a user by id
  *
  * @param int $userId
  * @return mixed
  */
 public function getUserById($userId)
 {
     $query = $this->db->createQueryBuilder();
     return $query->select('*')->from('users')->where($query->expr()->eq('id', $userId))->execute()->fetch();
 }
Beispiel #2
0
 /**
  * Checks if session has a key set
  *
  * @param string $key
  * @return bool
  */
 public function has($key)
 {
     $query = $this->db->createQueryBuilder();
     $value = $query->select('count(*)')->from('sessions')->where($query->expr()->eq('name', ':key'))->setParameter(':key', $key)->execute()->fetchColumn();
     return (bool) $value;
 }