\DomainSpecificEmailField
Extension to {@link EmailField} that adds the ability to limit which domains are allowed for the email address.
Wildcards are supported.
- Author: Maxime Rainville <max@firebrand.nz>
- Copyright: Firebrand Holdings Limited 2016
- License: https://raw.githubusercontent.com/firebrandhq/domain-specific-memberprofiles/master/LICENSE MIT License
Synopsis
class DomainSpecificEmailField
extends EmailField
{
- // members
- protected [string] $allowedDomains = ;
- protected [string] $disallowed = ;
- protected bool $showListOnError = false;
- // methods
- public static DomainSpecificEmailField createFrom()
- public DomainSpecificEmailField setAllowedDomains()
- public [string] getAllowedDomains()
- public DomainSpecificEmailField setDisallowedDomains()
- public [string] getDisallowedDomains()
- public DomainSpecificEmailField setShowListOnError()
- public bool getShowListOnError()
- public void validate()
- protected bool validateDomain()
- public bool|string getDomain()
- protected [string] getLines()
- protected bool valueInList()
Hierarchy
Extends
- EmailField
Members
protected
Methods
protected
- getLines() — Split a string by line and remove the empty lines.
- validateDomain() — Validate the value of this EmailField agianst our list of allowed and disallowed domains
- valueInList() — Check if the given domain mataches any of the provided lines. Entries in line may contain wildcards.
public
- createFrom() — Create a new DomainSpecificEmailField based on the provided TextField.
- getAllowedDomains() — Return the list of Allowed Domains
- getDisallowedDomains() — Return the list of Disallowed Domains
- getDomain() — Extract the domain part of the field's current value.
- getShowListOnError() — Whatever to show the domains restriction to the user if the validation fails.
- setAllowedDomains() — Set which domains are allowed. If not define, this condition will be ignored.
- setDisallowedDomains() — Set which domains are disallowed. If not define, this condition will be ignored.
- setShowListOnError() — Set whatever to show the domains restriction to the user if the validation fails.
- validate()