1 | <?php |
||
28 | trait DecoratableTrait |
||
29 | { |
||
30 | |||
31 | /** |
||
32 | * Condition decorator instance |
||
33 | * @var ConditionDecoratorInterface |
||
34 | */ |
||
35 | private $cd = null; |
||
36 | |||
37 | /** |
||
38 | * Get condition interface |
||
39 | * @return ConditionDecoratorInterface |
||
40 | */ |
||
41 | 98 | public function getCd() |
|
45 | |||
46 | /** |
||
47 | * Set condition decorator interface |
||
48 | * @param ConditionDecoratorInterface $cd |
||
49 | * @return CriteriaInterface |
||
50 | */ |
||
51 | 107 | public function setCd(ConditionDecoratorInterface $cd) |
|
56 | |||
57 | /** |
||
58 | * Decorate and sanitize criteria with provided model. |
||
59 | * @param AnnotatedInterface $model Model to use for decorators and sanitizer when creating conditions. If null no decorators will be used. If model is provided it's sanitizers and decorators will be used. |
||
60 | * @param ConditionDecoratorInterface $decorator |
||
61 | * @return CriteriaInterface |
||
62 | */ |
||
63 | 104 | public function decorateWith($model, ConditionDecoratorInterface $decorator = null) |
|
75 | |||
76 | } |
||
77 |