Skip to content
PHP Ecosystem
Explore

Message

API reference › Model › Exception › Message

enumUIAwesome\Model\Exception\Message
Backed bystring
Sourcesrc/Exception/Message.php

Represents reusable error message templates for model exceptions.

Use Message::getMessage() to format template values via sprintf() placeholders.

CaseValueDescription
CAST_SEPARATOR_EMPTY'Cast separator cannot be empty.'Indicates an empty Cast separator.
CAST_TARGET_EMPTY'Cast target cannot be empty.'Indicates an empty Cast target.
COLLECTOR_MODEL_CLASS_MISMATCH"Cannot rebind collector for '%s' to model of class '%s'."Indicates an attempt to reuse collector metadata with a different model class.
DUPLICATE_MAP_FROM_KEY"Duplicate MapFrom key '%s' in '%s::%s' and '%s::%s'."Indicates duplicate input-key mapping across model properties.
INVALID_CAST_CLASS"Cast target '%s' for '%s::%s' must implement '%s'."Indicates cast class does not implement required caster contract.
INVALID_CAST_TARGET"Invalid Cast target '%s' for '%s::%s'."Indicates unsupported cast target for a model property.
INVALID_DATE_TIME_STRING"Invalid date/time string '%s' for type '%s'."Indicates invalid string input for date/time object casting.
MAP_FROM_KEY_EMPTY'MapFrom key cannot be empty.'Indicates an empty MapFrom input key.
READONLY_PROPERTY_ALREADY_INITIALIZED"Cannot overwrite initialized readonly property: '%s::%s'."Indicates attempts to overwrite an initialized readonly property.
UNDEFINED_PROPERTY"Undefined property: '%s'."Indicates an undefined property without model class context.
UNDEFINED_PROPERTY_WITH_CLASS"Undefined property: '%s::%s'."Indicates an undefined property including model class context.
MethodDescriptionDefined by
getMessage()Returns the formatted message string for the error case.Message
public function getMessage(int|string ...$argument): string

Returns the formatted message string for the error case.

Parameters

ParameterTypeDescription
...$argumentint|stringValues to insert into the message template.

Returns

string: Formatted error message with interpolated arguments.