예제 #1
0
 /**
  * @param $name
  * @param User $user
  * @return TodoList
  */
 public function create($name, User $user)
 {
     $todolist = new TodoList();
     $todolist->name = $name;
     $user->todolist()->save($todolist);
     return $todolist;
 }
예제 #2
0
 /**
  * @param UserRegistrationDTO $user
  * @return User
  */
 public function saveUser(UserRegistrationDTO $user)
 {
     $newUser = new User();
     $newUser->name = $user->getName();
     $newUser->email = $user->getEmail();
     $newUser->password = $user->getPassword();
     $newUser->save();
     return $newUser;
 }