1 | <?php |
||
10 | trait GetByReference |
||
11 | { |
||
12 | /** |
||
13 | * @var object |
||
14 | */ |
||
15 | protected $source; |
||
16 | |||
17 | /** |
||
18 | * @var object|array |
||
19 | */ |
||
20 | protected $target; |
||
21 | |||
22 | |||
23 | /** |
||
24 | * Get copy of processor that uses the given source and target |
||
25 | * |
||
26 | * @param object $source Data source |
||
27 | * @param array|object $target Target or dot key path |
||
28 | */ |
||
29 | 1 | public function withSourceAndTarget($source, $target) |
|
38 | |||
39 | /** |
||
40 | * Get item by reference |
||
41 | * |
||
42 | * @param string $ref |
||
43 | * @param object $source |
||
44 | * @param object|array $target |
||
45 | */ |
||
46 | 1 | protected function getByReference($ref, $source, $target) |
|
65 | } |
||
66 |