Truncate
Less than 1 minute
Truncate
class Truncate extends \Hazaar\Model\Attribute\BaseExtends: Hazaar\Model\Attribute\Base
Properties
length
The maximum length to truncate the string property to.
private int $lengthType: int
Methods
__construct
Constructor for the Truncate attribute.
public __construct(int $length): voidParameters
| Parameter | Type | Description |
|---|---|---|
$length | int | the maximum length to truncate the string property to |
evaluate
Truncates the string property value to the specified maximum length.
public evaluate(mixed $propertyValue, \ReflectionProperty $property): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$propertyValue | mixed | the value of the property to truncate (passed by reference) |
$property | ReflectionProperty | the reflection property instance for metadata (passed by reference) |
getLength
Gets the maximum length to truncate the string property to.
public getLength(): intReturns: int
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:17 +0000