Class UnderscoreIdFieldDecorator
ElasticSearch 2.x does not allow _id
fields, this is to prevent storing such fields.
-
Maslosoft\Manganel\Decorators\UnderscoreIdFieldDecorator
implements
Maslosoft\Mangan\Interfaces\Decorators\Model\ModelDecoratorInterface
Methods summary
public
boolean
|
#
read( Maslosoft\Addendum\Interfaces\AnnotatedInterface $model, mixed & $dbValues, string $transformatorClass = Maslosoft\Manganel\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
- $dbValues
- $transformatorClass
- Transformator class used
Returns
boolean Return true if value should be assigned to model
|
public
boolean
|
#
write( Maslosoft\Addendum\Interfaces\AnnotatedInterface $model, mixed[] & $dbValues, string $transformatorClass = Maslosoft\Manganel\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
- $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
|