UpdateVirtualTrait
This modifies the behaviour of a DataObject/Collection for updating complex properties, such as arrays and objects.
use Cast or property hooks in php 8.4
Table of Contents
Methods
- virtual() : array<string|int, callable>
- A list of converter functions to apply to the data before saving.
- applyVirtual() : void
- Apply the virtual converters to the all properties.
Methods
virtual()
A list of converter functions to apply to the data before saving.
public
virtual() : array<string|int, callable>
Example:
[
'destinations' => [$this, 'setDestinations'],
'some_string_i_guess' => 'trim',
]
Return values
array<string|int, callable>applyVirtual()
Apply the virtual converters to the all properties.
protected
applyVirtual() : void
Recommended placements:
__clone()update()