| @@ 457-465 (lines=9) @@ | ||
| 454 | * |
|
| 455 | * @return Item |
|
| 456 | */ |
|
| 457 | public function addName(Name $name) |
|
| 458 | { |
|
| 459 | $names = array_map('strval', $this->names->toArray()); |
|
| 460 | if (!in_array($name->getName(), $names)) { |
|
| 461 | $this->names->add($name); |
|
| 462 | $name->setItem($this); |
|
| 463 | } |
|
| 464 | ||
| 465 | return $this; |
|
| 466 | } |
|
| 467 | ||
| 468 | /** |
|
| @@ 710-718 (lines=9) @@ | ||
| 707 | * |
|
| 708 | * @return Item |
|
| 709 | */ |
|
| 710 | public function addSource(Source $source) |
|
| 711 | { |
|
| 712 | $sources = array_map('strval', $this->sources->toArray()); |
|
| 713 | if (!in_array($source->getUrl(), $sources)) { |
|
| 714 | $this->sources->add($source); |
|
| 715 | $source->setItem($this); |
|
| 716 | } |
|
| 717 | ||
| 718 | return $this; |
|
| 719 | } |
|
| 720 | ||
| 721 | /** |
|
| @@ 749-757 (lines=9) @@ | ||
| 746 | * |
|
| 747 | * @return Item |
|
| 748 | */ |
|
| 749 | public function addImage(Image $image) |
|
| 750 | { |
|
| 751 | $images = array_map('strval', $this->images->toArray()); |
|
| 752 | if (!in_array($image->getSource(), $images)) { |
|
| 753 | $this->images->add($image); |
|
| 754 | $image->setItem($this); |
|
| 755 | } |
|
| 756 | ||
| 757 | return $this; |
|
| 758 | } |
|
| 759 | ||
| 760 | /** |
|