1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Mcneely\Core\Traits; |
6
|
|
|
|
7
|
|
|
use ArrayAccess; |
8
|
|
|
use Mcneely\Core\CoreObject; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Trait ArrayAccessTrait. |
12
|
|
|
* |
13
|
|
|
* @package Mcneely\Core\Traits |
14
|
|
|
* |
15
|
|
|
* @method mixed setCoreObject_CoreTrait() |
16
|
|
|
* @method CoreObject CoreTrait_getCoreObject() |
17
|
|
|
* @method mixed fireEvents_CoreTrait($eventClassObject, $eventImmediateClass, $eventMethod, $eventTrait) |
18
|
|
|
*/ |
19
|
|
|
trait ArrayAccessTrait |
20
|
|
|
{ |
21
|
2 |
|
public function offsetExists($offset) |
22
|
|
|
{ |
23
|
2 |
|
$this->CoreTrait_fireEvents($this, __CLASS__, __METHOD__, __TRAIT__); |
|
|
|
|
24
|
|
|
|
25
|
|
|
return $this |
26
|
2 |
|
->ArrayAccessTrait_unwrap() |
27
|
2 |
|
->offsetExists($offset) |
28
|
|
|
; |
29
|
|
|
} |
30
|
|
|
|
31
|
2 |
|
protected function ArrayAccessTrait_unwrap(): ArrayAccess |
32
|
|
|
{ |
33
|
|
|
return $this |
|
|
|
|
34
|
2 |
|
->CoreTrait_getCoreObject() |
35
|
2 |
|
->unWrap(ArrayAccess::class) |
36
|
|
|
; |
37
|
|
|
} |
38
|
|
|
|
39
|
1 |
|
public function offsetGet($offset) |
40
|
|
|
{ |
41
|
1 |
|
$this->CoreTrait_fireEvents($this, __CLASS__, __METHOD__, __TRAIT__); |
42
|
|
|
|
43
|
|
|
return $this |
44
|
1 |
|
->ArrayAccessTrait_unwrap() |
45
|
1 |
|
->offsetGet($offset) |
46
|
|
|
; |
47
|
|
|
} |
48
|
|
|
|
49
|
1 |
|
public function offsetSet($offset, $value) |
50
|
|
|
{ |
51
|
1 |
|
$this->CoreTrait_fireEvents($this, __CLASS__, __METHOD__, __TRAIT__); |
52
|
|
|
|
53
|
|
|
$this |
54
|
1 |
|
->ArrayAccessTrait_unwrap() |
55
|
1 |
|
->offsetSet($offset, $value) |
56
|
|
|
; |
57
|
|
|
|
58
|
1 |
|
return $this; |
59
|
|
|
} |
60
|
|
|
|
61
|
1 |
|
public function offsetUnset($offset) |
62
|
|
|
{ |
63
|
1 |
|
$this->CoreTrait_fireEvents($this, __CLASS__, __METHOD__, __TRAIT__); |
64
|
|
|
$this |
65
|
1 |
|
->ArrayAccessTrait_unwrap() |
66
|
1 |
|
->offsetUnset($offset) |
67
|
|
|
; |
68
|
|
|
|
69
|
1 |
|
return $this; |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|