Class RelatedDecorator
-
Maslosoft\Mangan\Decorators\RelatedDecorator
implements
Maslosoft\Mangan\Interfaces\Decorators\Property\DecoratorInterface
Methods summary
public
boolean
|
#
read( AnnotatedInterface $model, string $name, mixed & $dbValue, string $transformatorClass = Maslosoft\Mangan\Decorators\TransformatorInterface::class )
This will be called when getting value.
This should return end user value.
This will be called when getting value.
This should return end user value.
Parameters
- $model
- Document model which will be decorated
- $name
- Field name
- $dbValue
- $transformatorClass
- Transformator class used
Returns
boolean Return true if value should be assigned to model
Implementation of
|
public
boolean
|
#
write( AnnotatedInterface $model, string $name, mixed[] & $dbValues, string $transformatorClass = Maslosoft\Mangan\Decorators\TransformatorInterface::class )
This will be called when setting value.
This should return db acceptable value
This will be called when setting value.
This should return db acceptable value
Parameters
- $model
- Model which is about to be decorated
- $name
- Current field name
- $dbValues
- Whole model values from database. This is associative array with keys same as model properties (use $name param to access value). This is passed by reference.
- $transformatorClass
- Transformator class used
Returns
boolean Return true to store value to database
Implementation of
|