/** * @param WishListSetItem $item */ public function addItem(WishListSetItem $item) { if (count($this->items) === 0) { $this->setItemAppId = $item->getAppId(); } elseif ($this->setItemAppId !== $item->getAppId()) { throw new \InvalidArgumentException('you can not set different app ids for items in an item-set.'); } $this->items[] = $item; }