1 | <?php |
||
24 | abstract class AbstractDelegateContextualBuilderHydrator extends AbstractDelegateBuilderHydrator implements |
||
25 | ContextualBuilder, |
||
26 | ContextualHydrator |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * Properties |
||
31 | */ |
||
32 | |||
33 | /** |
||
34 | * Whether or not to provide a fallback empty context, when a `null` context |
||
35 | * is otherwise provided, to make processes simpler by not having to rely on |
||
36 | * null checks of the actual parameter before usage. |
||
37 | * |
||
38 | * @var bool |
||
39 | */ |
||
40 | private $provide_fallback_context = false; |
||
41 | |||
42 | |||
43 | /** |
||
44 | * Methods |
||
45 | */ |
||
46 | |||
47 | /** |
||
48 | * Constructor |
||
49 | * |
||
50 | * @param bool $provide_fallback_context Whether or not to provide a |
||
51 | * fallback empty context, when a `null` context is otherwise provided, to |
||
52 | * make processes simpler by not having to rely on null checks of the |
||
53 | * actual parameter before usage. |
||
54 | */ |
||
55 | 12 | protected function __construct(bool $provide_fallback_context = false) |
|
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | * |
||
63 | * @param mixed $incoming The input data. |
||
64 | * @param Map|null $context An optional generic key-value map, for providing |
||
65 | * contextual values during the build process. |
||
66 | * @return mixed The built model. |
||
67 | */ |
||
68 | 6 | public function build($incoming, Map $context = null) |
|
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | * |
||
83 | * @param mixed $incoming The input data. |
||
84 | * @param mixed $model The model to hydrate. |
||
85 | * @param Map|null $context An optional generic key-value map, for providing |
||
86 | * contextual values during the hydrate process. |
||
87 | * @return mixed The hydrated model. |
||
88 | */ |
||
89 | 6 | public function hydrate($incoming, $model, Map $context = null) |
|
100 | } |
||
101 |