Closed bakura10 closed 11 years ago
@bakura10 I like :)
I'm not going to accept this one; It makes the service layer completely obsolete. What we discussed earlier was exchanging the form against input-filter and hydrator.
But it replaced it !
Input filters and hydrators are bound to the form, so people using form will just need to do that in their controllers:
$form = $serviceLocator->get('FormElementManager')->getRegistrationForm();
$form->setData($_POST);
if ($form->isValid) {
$userService->register($form->getData());
}
As it is today it's not usable with REST. The service is not obsolete at all. It needs to have an event manager too (to send mails). So I suggest reopening the branch =).
@bakura10 I think @DASPRiD is right here - instantiating the user object is up to the service layer here. The InputFilter fix seems ok on the other side... Can lead to double validation, but that's no problem either imo :)
This one needs re-evaluation.
ping @ocramius, @mac_nibblet, @Dasprids
As told on IRC, this PR removes the form from the service, so that it is decouples and allow to use BaconUser in REST context.
Now, the user is responsible to fetch the form in the controller, validate the data, and pass the correct user to the service.