<?php
/**
* A concrete filter for validating the email address. This filter may intercept
- * the filter chain if no email address is given or if the supplied email has an
- * invalid form. It could also intercept the filter chain if the email address
- * is already used by some one if configuration requires this.
+ * the filter chain if no email address is given or if supplied email has an
+ * invalid form. It could also intercept our filter chain if email address is
+ * already used by some one if configuration requires this.
*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
/**
* Creates an instance of this filter class
*
- * @return $filterInstance An instance of this filter class
+ * @param $controllerInstance An instance of a Controller class
+ * @return $filterInstance An instance of this filter class
*/
- public final static function createEmailValidatorFilter () {
+ public final static function createEmailValidatorFilter (Controller $controllerInstance) {
// Get a new instance
$filterInstance = new EmailValidatorFilter();
+ // Set the controller
+ $filterInstance->setControllerInstance($controllerInstance);
+
// Return the instance
return $filterInstance;
}
}
// Does the email exist?
- if (!$userInstance->ifEmailAddressExists()) {
+ if ($userInstance->ifEmailAddressExists() === false) {
// This email has not being used yet
$alreadyTaken = false;
}