| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait HasMeta |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array stores the meta items for this class |
||
| 11 | */ |
||
| 12 | protected $_meta = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Returns the meta items |
||
| 16 | * |
||
| 17 | * @return array |
||
| 18 | */ |
||
| 19 | public function meta() { |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Adds a meta item |
||
| 26 | * |
||
| 27 | * @param $fields |
||
| 28 | */ |
||
| 29 | public function addMeta($fields) { |
||
| 30 | $this->_meta = array_merge($this->_meta, $fields); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Replaces a meta item |
||
| 35 | * |
||
| 36 | * @param $key |
||
| 37 | * @param $value |
||
| 38 | */ |
||
| 39 | public function replaceMeta($key, $value) { |
||
| 41 | } |
||
| 42 | } |