/** * Checks if value passed is in a valid email format.<p> * * @param object $value any type of value that needs to be checked. * @param string $message name of value being passed, used in error message. * @param bool $letReturn will determine if it throws an PHException or returns true. * @return bool will either return false if not and on success will return true if allowed. */ public function isEmail($value, $letReturn = false) { if (!EmailAddressValidatorUtil::check_email_address($value)) { if (!$letReturn) { ErrorsUtil::error("Email is not in a valid email format.", ServiceCodes::INVALID_EMAIL_ERROR, null); } else { return false; } } else { return true; } }