SilverCart\Forms\CustomRequiredFields
custom form definition.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class CustomRequiredFields
extends RequiredFields
{
- // members
- private static string $password_pattern = '^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=\S+$).{8,}$';
- private static integer $password_minlength = 8;
- protected array $requiredCallbacks = ;
- // methods
- public array getRequiredCallbacks()
- public void setRequiredCallbacks()
- public void addRequiredCallback()
- public bool hasRequiredCallbacks()
- public bool fieldHasRequiredProperty()
- public boolean validateWithCallbacks()
- protected void handleCallbackValidation()
- public boolean php()
- public array doesEmailExist()
- public array hasLength()
- public array hasMinAge()
- public array hasMinLength()
- public array hasSpecialSigns()
- public array isCurrency()
- public array isDecimalNumber()
- public array isEmailAddress()
- public array isValidPassword()
- public array isFilledIn()
- public array isFilledInDependentOn()
- public array isNumbersOnly()
- public array isPhoneNumber()
- public array isValidDependentOn()
- public array mustEqual()
- public array mustEqualDependentOn()
- public array mustNotEqual()
- public array mustNotEqualDependentOn()
- public boolean isValidEmailAddress()
- private string email_strip_comments()
Hierarchy
Extends
- SilverStripe\Forms\RequiredFields
Members
private
- $password_minlength
—
int
Password min length. - $password_pattern
—
string
Password validation pattern.
protected
- $requiredCallbacks
—
array
List of required fields with callbacks.
Methods
private
- email_strip_comments() — Taken from "https://github.com/iamcal/rfc822".
protected
- handleCallbackValidation() — Handles the callback validation for the given formfield.
public
- addRequiredCallback() — Adds a required field with callback to the list.
- doesEmailExist() — Does the given email address exists in database?
- fieldHasRequiredProperty() — Returns true if the named field is "required" AND hasn't the "isFilledInDependentOn" callback.
- getRequiredCallbacks() — Returns the list of required fields with callbacks.
- hasLength() — Does the input string match the length defined? Whitespaces do not count
- hasMinAge() — Does the input strings have the minimum age?
- hasMinLength() — Does the input strings have the minimum length? Whitespaces do not count
- hasRequiredCallbacks() — Returns if the list of required fields with callbacks contains elements.
- hasSpecialSigns() — Checks if input containes special chars and if the result corresponds to the expected result
- isCurrency() — Checks if the field input is a currency
- isDecimalNumber() — Does a field contain only characters for quantity specification?
- isEmailAddress() — Checks, whether the given string matches basicly an email address.
- isFilledIn() — Checks if a field is empty and if this result is expected
- isFilledInDependentOn() — Is the field empty? If a dependent field is not filled in an error will be returned
- isNumbersOnly() — Does a field contain number only
- isPhoneNumber() — Checks if the given value fits with the rules for a phone number.
- isValidDependentOn() — Checks the validity of the field dependent of another field and a generic validation method.
- isValidEmailAddress() — Taken from "https://github.com/iamcal/rfc822".
- isValidPassword() — Checks if the given value is a valid password.
- mustEqual() — Do the values of two fields match?
- mustEqualDependentOn() — Checks the equality of two fields dependent of another field.
- mustNotEqual() — checks if two field values do NOT match (inversion of mustEqual())
- mustNotEqualDependentOn() — Checks the equality of two fields dependent of another field.
- php() — Allows validation of fields via specification of a php function for validation which is executed after the form is submitted.
- setRequiredCallbacks() — Sets the list of required fields with callbacks.
- validateWithCallbacks() — Validates the fields with the matching callback validation methods.