DeviceTypeContextParamValidator
extends AbstractContextParamValidator
in package
Table of Contents
Properties
- $errorMessage : string
- $maxLength : int
- $validDeviceTypes : array<string|int, mixed>
Methods
- getErrorMessage() : string
- Get the error message
- validate() : bool
- Validate the device type value
- validateMaxLength() : bool
- Validate that the value does not exceed the maximum length
- validateNotEmpty() : bool
- Validate that the value is not empty
Properties
$errorMessage
protected
string
$errorMessage
= ''
$maxLength
protected
int
$maxLength
= 255
$validDeviceTypes
private
array<string|int, mixed>
$validDeviceTypes
= array('desktop', 'tablet', 'mobile', 'other')
Methods
getErrorMessage()
Get the error message
public
getErrorMessage() : string
Return values
stringvalidate()
Validate the device type value
public
validate(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateMaxLength()
Validate that the value does not exceed the maximum length
protected
validateMaxLength(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateNotEmpty()
Validate that the value is not empty
protected
validateNotEmpty(mixed $value) : bool
Parameters
- $value : mixed