public function initNewUser(User $user) { if (!$user->isNew()) { throw new \RuntimeException('Cannot initialize existing user'); } $this->hashPassword($user); $user->refresh(); }
public function isNew() { $this->__load(); return parent::isNew(); }