1 | <?php |
||
2 | /** |
||
3 | * |
||
4 | */ |
||
5 | |||
6 | namespace Mvc5\Config; |
||
7 | |||
8 | trait ModelObject |
||
9 | { |
||
10 | /** |
||
11 | * |
||
12 | */ |
||
13 | use Count; |
||
14 | use Iterator; |
||
15 | |||
16 | /** |
||
17 | * @var Model |
||
18 | */ |
||
19 | protected Model $config; |
||
20 | |||
21 | /** |
||
22 | * @param array|Model $config |
||
23 | */ |
||
24 | 499 | function __construct($config = []) |
|
25 | { |
||
26 | 499 | $this->config = $config instanceof Model ? $config : new \Mvc5\ArrayObject((array) $config); |
|
27 | 499 | } |
|
28 | |||
29 | /** |
||
30 | * |
||
31 | */ |
||
32 | 101 | function __clone() |
|
33 | { |
||
34 | 101 | $this->config = $this->config instanceof Scopable ? $this->config->withScope($this) : clone $this->config; |
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
35 | 101 | } |
|
36 | } |
||
37 |