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