*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// First get a UserRegistration instance
- $managerInstance = ObjectFactory::createObjectByConfiguredName('city_manager_class');
+ $managerInstance = ManagerFactory::createManagerByType('city');
// First set request and response instance
$managerInstance->setRequestInstance($requestInstance);
$managerInstance->setResponseInstance($responseInstance);
- // Do things before adding city
- $managerInstance->doPreAddCity();
-
- // Add new city
- $managerInstance->addNewCity();
+ // Is there already a city the user has founded?
+ if ($managerInstance->isCityAlreadyFounded()) {
+ // Found 2nd,3rd,... city
+ $managerInstance->foundNewCity();
+ } else {
+ // Found first city
+ $managerInstance->foundFirstCity();
+ }
// Redirect or login after registration
$managerInstance->doPostAction();
// Validate user status ('confirmed' no guest)
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+ // Check if city name is already used
+ $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('city_name_verifier_filter'));
+
// Validate ...
//$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_filter'));
}