1 | <?php |
||
25 | class SearchClassNameDecorator implements ModelDecoratorInterface |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * This will be called when getting value. |
||
30 | * This should return end user value. |
||
31 | * @param AnnotatedInterface $model Document model which will be decorated |
||
32 | * @param mixed $dbValues |
||
33 | * @param string $transformatorClass Transformator class used |
||
34 | * @return bool Return true if value should be assigned to model |
||
35 | */ |
||
36 | 24 | public function read($model, &$dbValues, $transformatorClass = TransformatorInterface::class) |
|
40 | |||
41 | /** |
||
42 | * This will be called when setting value. |
||
43 | * This should return db acceptable value |
||
44 | * @param AnnotatedInterface $model Model which is about to be decorated |
||
45 | * @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. |
||
46 | * @param string $transformatorClass Transformator class used |
||
47 | * @return bool Return true to store value to database |
||
48 | */ |
||
49 | 53 | public function write($model, &$dbValues, $transformatorClass = TransformatorInterface::class) |
|
74 | |||
75 | } |
||
76 |