public function addUser(StorouUser $user) { $query = 'INSERT INTO users (name,email,password,userDisplayName) VALUES (?,?,?,?)'; //There should be a handy way to do this! $params = array($user->getUserName(), $user->getEmail(), $user->getPassword(), $user->getDisplayName()); $status = $this->executeQueryWithParams($query, $params); /* * In case use insert fails */ if (!$status) { throw new \Exception('Failed adding user to DB'); } return $this->getUserByKey('id', intval($this->pdo->lastInsertId())); }
protected function getUserMetaData(StorouUser $user) { $userMeta = $this->userDataProvider->getUserMetaFields($user->getId()); $user->setUserMetaData($userMeta); return $user; }