| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | class Vocabulary extends CecilCollection implements ItemInterface |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * Adds a term to a Vocabulary collection. |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | public function add(ItemInterface $item): CollectionInterface |
||
| 32 | { |
||
| 33 | if ($this->has($item->getId())) { |
||
| 34 | // return if already exists |
||
| 35 | return $this; |
||
| 36 | } |
||
| 37 | |||
| 38 | $this->items[] = $item; |
||
| 39 | |||
| 40 | return $this; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | public function get(string $id): Term |
||
| 49 | } |
||
| 50 | } |
||
| 51 |