SmallText
extends Type
in package
implements
TypeInterface
The SmallText complex data type.
Tags
Table of Contents
Interfaces
- TypeInterface
- The interface for all complex data types.
Constants
- MAX_SIZE = 255
- The absolute maximum size of the value for the this String.
Properties
- $helper : string
- The error message for the string type when validation fails.
- $password : bool
- Simple boolean to determine if the string is a password or not.
- $size : int
- The size of the value for the this String.
- $validationRule : string
- The validation rule for the string type.
- $value : string|null
- The value of the string.
Methods
- __construct() : mixed
- Constructor.
- __toString() : string
- Used to convert the object to a printable string.
- checkIsPassword() : bool
- Checks to see if the string is a password or not.
- getHelper() : string
- Used to get the validation helper message string.
- getRule() : string
- Get the validation rule.
- getSize() : int
- Get the allowable size of the Double in the database field.
- getValue() : string|null
- Getter for the value.
- isPassword() : void
- Define the string as a password (making it required by validation rule).
- isRequired() : void
- Sets up an appropriate validation rule for a required field.
- setHelper() : void
- Set the validation helper text.
- setRule() : void
- Setter to override the default validation rule.
- setSize() : void
- Used to set the allowable size of the String in the database field.
- setValue() : void
- Setter for the value.
Constants
MAX_SIZE
The absolute maximum size of the value for the this String.
public
int
MAX_SIZE
= 255
Tags
Properties
$helper
The error message for the string type when validation fails.
protected
string
$helper
= 'Not a valid smalltext value!'
Tags
$password
Simple boolean to determine if the string is a password or not.
private
bool
$password
= false
Tags
$size
The size of the value for the this String.
private
int
$size
= 255
Tags
$validationRule
The validation rule for the string type.
private
string
$validationRule
Tags
$value
The value of the string.
private
string|null
$value
Tags
Methods
__construct()
Constructor.
public
__construct([string|null $val = '' ]) : mixed
Parameters
- $val : string|null = ''
Tags
__toString()
Used to convert the object to a printable string.
public
__toString() : string
Tags
Return values
stringcheckIsPassword()
Checks to see if the string is a password or not.
public
checkIsPassword() : bool
Tags
Return values
boolgetHelper()
Used to get the validation helper message string.
public
getHelper() : string
Tags
Return values
stringgetRule()
Get the validation rule.
public
getRule() : string
Tags
Return values
stringgetSize()
Get the allowable size of the Double in the database field.
public
getSize() : int
Tags
Return values
intgetValue()
Getter for the value.
public
getValue() : string|null
Tags
Return values
string|nullisPassword()
Define the string as a password (making it required by validation rule).
public
isPassword([bool $pass = true ]) : void
Parameters
- $pass : bool = true
Tags
isRequired()
Sets up an appropriate validation rule for a required field.
public
isRequired([bool $req = true ]) : void
Parameters
- $req : bool = true
Tags
setHelper()
Set the validation helper text.
public
setHelper(string $helper) : void
Parameters
- $helper : string
Tags
setRule()
Setter to override the default validation rule.
public
setRule(string $rule) : void
Parameters
- $rule : string
Tags
setSize()
Used to set the allowable size of the String in the database field.
public
setSize(int $size) : void
Parameters
- $size : int
Tags
setValue()
Setter for the value.
public
setValue(mixed $val) : void
Parameters
- $val : mixed