public function hasItem(Item $item, bool $initialOnly = true): bool
    {
        $list = ($initialOnly) ? $this->initialItems : $this->items;
        foreach ($list as $my_item) {
            if (0 === Item::compare($my_item, $item)) {
                return true;
            }
        }
        return false;
    }
public function hasItem(Item $item, bool $initialOnly = true): bool
    {
        $list = ($initialOnly) ? $this->initialItems : $this->items;
        foreach ($list as $my_item) {
            if (0 === Item::compare($my_item, $item)) {
                return true;
            }
        }
        return false;
    }
public function hasItem ( Item $ item , bool $ initialOnly = true ) : bool { $ list = ( $ initialOnly ) ? $ this -> initialItems : $ this -> items ; foreach ( $ list as $ my_item ) { if ( 0 === Item :: compare ( $ my_item , $ item ) ) { return true ; } } return false ; }
Check if this set contains an equal Item
@param Item $item Item to search
@param bool $initialOnly Whether to search in initial items only
@return bool Returns `true` when the set contains equal item
Check if this set contains an equal Item