1 | <?php |
||
15 | class SearchClassNameDecorator implements ModelDecoratorInterface |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * This will be called when getting value. |
||
20 | * This should return end user value. |
||
21 | * @param AnnotatedInterface $model Document model which will be decorated |
||
22 | * @param mixed $dbValues |
||
23 | * @param string $transformatorClass Transformator class used |
||
24 | * @return bool Return true if value should be assigned to model |
||
25 | */ |
||
26 | 36 | public function read($model, &$dbValues, $transformatorClass = TransformatorInterface::class) |
|
30 | |||
31 | /** |
||
32 | * This will be called when setting value. |
||
33 | * This should return db acceptable value |
||
34 | * @param AnnotatedInterface $model Model which is about to be decorated |
||
35 | * @param mixed[] $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. |
||
36 | * @param string $transformatorClass Transformator class used |
||
37 | * @return bool Return true to store value to database |
||
38 | */ |
||
39 | 60 | public function write($model, &$dbValues, $transformatorClass = TransformatorInterface::class) |
|
63 | |||
64 | } |
||
65 |