_db = $db; $this->userId = $userId; $this->getPlayerAccount($this->userId); } /** * @param $userId */ private function getPlayerAccount($userId) { $this->_db->query("SELECT * FROM users WHERE userId = :userId LIMIT 0,1"); $this->_db->bind(':userId', $userId); $this->userData = $this->_db->single(); } /** * @param $value * @return mixed|string */ public function getValue($value) { if(isset($this->userData[$value])) { return $this->userData[$value]; } else { return 'N/A'; } } }