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()));
 }
Exemple #2
0
 protected function getUserMetaData(StorouUser $user)
 {
     $userMeta = $this->userDataProvider->getUserMetaFields($user->getId());
     $user->setUserMetaData($userMeta);
     return $user;
 }