Total Complexity | 10 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class MultiAsset extends Field implements \ArrayAccess |
||
10 | { |
||
11 | public function __toString() |
||
12 | { |
||
13 | // TODO |
||
14 | return ''; |
||
15 | } |
||
16 | |||
17 | public function init() { |
||
18 | if ($this->hasFiles()) { |
||
19 | $this->content = collect($this->content())->transform(function ($file) { |
||
20 | return new Asset($file); |
||
21 | }); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | public function hasFiles() { |
||
27 | } |
||
28 | |||
29 | /* |
||
30 | * Methods for ArrayAccess Trait - allows us to dig straight down to the content collection |
||
31 | * when calling a key on the Object |
||
32 | * */ |
||
33 | public function offsetSet($offset, $value) { |
||
34 | if (is_null($offset)) { |
||
35 | $this->content[] = $value; |
||
36 | } else { |
||
37 | $this->content[$offset] = $value; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | public function offsetExists($offset) { |
||
42 | return isset($this->content[$offset]); |
||
43 | } |
||
44 | |||
45 | public function offsetUnset($offset) { |
||
47 | } |
||
48 | |||
49 | public function offsetGet($offset) { |
||
51 | } |
||
52 | } |