MaxLength
Less than 1 minute
MaxLength
class MaxLength extends \Hazaar\Model\Attribute\BaseProperties
length
The maximum allowed length for the string property.
private int $lengthMethods
__construct
Constructor for the MaxLength attribute.
public __construct(int $length): voidParameters
| Parameter | Type | Description |
|---|---|---|
$length | int | the maximum length allowed for the string property |
evaluate
Evaluates whether the string property value is at most the maximum allowed length.
public evaluate(mixed $propertyValue, \ReflectionProperty $property): boolParameters
| Parameter | Type | Description |
|---|---|---|
$propertyValue | mixed | the value of the property to evaluate (passed by reference) |
$property | \ReflectionProperty | the reflection property instance for metadata (passed by reference) |
getLength
Gets the maximum allowed length for the string property.
public getLength(): intgetReason
Returns a human-readable reason for attribute rule failure.
public getReason(): stringGenerated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:23 +0000