public function handle(EntityManager $em) { $user = new User(); $user->setFirstName($this->first_name); $user->setLastName($this->last_name); $user->setEmailAddress($this->email_address); $user->setPassword(bcrypt($this->password)); $em::persist($user); $em::flush(); return $user; }
public function transform(User $user) { return ['id' => (int) $user->getId(), 'first_name' => $user->getFirstName(), 'last_name' => $user->getLastName(), 'email_address' => $user->getEmailAddress(), 'published' => (bool) 1, 'date_published' => 'September 13, 2015', 'active' => (int) 1]; }