/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof ItemCollection) { return false; } if ($this->count() !== $other->count()) { return false; } foreach ($this->itemCollection as $myItem) { if (!$other->has($myItem)) { return false; } } return true; }