Skip to content
PHP Ecosystem
Explore

Cast

API reference › Model › Attribute › Cast

final readonly classUIAwesome\Model\Attribute\Cast
Sourcesrc/Attribute/Cast.php

Forces custom casting before native property type casting.

PropertyTypeDescriptionDefined by
$separator readonlystringSeparates string items when casting to an array.Cast
$target readonlystringIdentifies the cast type or custom caster class.Cast
MethodDescriptionDefined by
__construct()Configures a nonempty cast target and array separator.Cast
public function __construct(string $target, string $separator = ',')

Configures a nonempty cast target and array separator.

Parameters

ParameterTypeDescription
$targetstringCast type or custom caster class.
$separatorstringNonempty separator for array casts.

Throws