| 1 | <?php |
||
| 20 | trait Container |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var array Container of elements |
||
| 24 | */ |
||
| 25 | protected $container = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Set key/value pair |
||
| 29 | * |
||
| 30 | * @param string $key |
||
| 31 | * @param mixed $value |
||
| 32 | * @return void |
||
| 33 | */ |
||
| 34 | protected function doSetContainer($key, $value) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get value by key |
||
| 41 | * |
||
| 42 | * @param string $key |
||
| 43 | * @return mixed |
||
| 44 | */ |
||
| 45 | protected function doGetContainer($key) |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Check contains key in container |
||
| 56 | * |
||
| 57 | * @param string $key |
||
| 58 | * @return bool |
||
| 59 | */ |
||
| 60 | protected function doContainsContainer($key) |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Delete value by key |
||
| 67 | * |
||
| 68 | * @param string $key |
||
| 69 | * @return void |
||
| 70 | */ |
||
| 71 | protected function doDeleteContainer($key) |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Sets all data in the row from an array |
||
| 78 | * |
||
| 79 | * @param array $data |
||
| 80 | * @return self |
||
| 81 | */ |
||
| 82 | public function setFromArray(array $data) |
||
| 89 | |||
| 90 | /** |
||
| 91 | * Returns the column/value data as an array |
||
| 92 | * |
||
| 93 | * @return array |
||
| 94 | */ |
||
| 95 | public function toArray() |
||
| 99 | |||
| 100 | /** |
||
| 101 | * Reset container array |
||
| 102 | * |
||
| 103 | * @return self |
||
| 104 | */ |
||
| 105 | public function resetArray() |
||
| 112 | } |
||
| 113 |