Removes the specified item from the menu. Ensures the menu item remains immutable.

@param MenuItem $item

@return MenuItem
762425
public function withoutItem (MenuItem $item)
    {
        $cloned = clone $this;
        
        foreach ($cloned->items as $storedIndex => $storedItem) {
            if ($storedItem === $item) {
                unset($cloned->items[$storedIndex]);
                break;
            }
        }
        
        return $cloned;
    }
1129519
public function get($item)
    {
        $key = $this->getItemKey($item);

        if (null !== $key) {
            if (isset($this->items[$key])) {
                $item = $this->items[$key];
            } else {
                $this->items[$key] = $item;
            }
        }

        return $item;
    }
71699
public function shift(& $item) : Vector
    {
        $values = $this->_shift($item);
        $this->setValues($values);
        return $this;
    }
1075613
public function removeItem(LayoutItem $item)
    {
        $itemId = spl_object_hash($item);

        foreach ($this as $myItem) {
            if ($itemId == spl_object_hash($myItem)) {
                return $this->remove($myItem->getRow(), $myItem->getColumn());
            }
        }

        return $this;
    }
1352921
public function setItem(Item $item = null)
    {
        if ($this->item !== $item) {
            // romove link on this item for old item
            if ($this->item instanceof Item) {
                $tmp = $this->item;
                $this->item = null;
                $tmp->removeName($this);
            }
            $this->item = $item;
            // add link on this item
            if ($item instanceof Item) {
                $this->item->addName($this);
            }
        }

        return $this;
    }
661121
public function remove( $item )
	{
		if( !in_array( $item, $this->list ) )
			throw new DomainException( 'Item "'.$item.'" is not existing.' );
		$index	= array_search( $item, $this->list );
		unset( $this->list[$index] );
		return $this->write();
	}
1345461
public function removeItem(ItemInterface $item)
    {
        $this->itemsChanged = true;
        $this->entity->removeItem($item);

        return $this;
    }
645308
public function unshift($item)
    {
        $this->onBeforeInsert($item);
        $item->setContainerFieldList($this);

        return parent::unshift($item);
    }
1213601
public function addItem(MenuItem $item) {
        if($item instanceof ResourceMenuItem){
            throw new \InvalidArgumentException('ResourceMenuItem passed to Resource::addItem(MenuItem). You cannot nest ResourceMenuItems.');
        }

        $this->items[] = $item;

        return $this;
    }
265980
public function removeItem($item)
    {
        $key = $this->getKey($item);
        if ($key !== false) {
            $this->offsetUnset($key);
        }
    }
831129
public static function removeMarginalElement($item, $last = true)
    {
        if (is_string($item)) {
            if ($last) {
                $item = substr($item, 0, -1);
            } else {
                $item = substr($item, 1);
            }
        } elseif (is_array($item)) {
            $key = self::getFirstKey($item);

            if ($last) {
                $key = self::getLastKey($item);
            }

            unset($item[$key]);
        }

        return $item;
    }
630019
protected function removeItem($item)
    {
        if (is_string($item)) {
            $item = $this->findItem($item);
        }

        echo "    > removing $item->name ...";
        $time = microtime(true);
        $this->authManager->remove($item);
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
    }
179080
public function removeItem(ItemInterface $item)
    {
        $item->setGrid(null);
        $this->items->removeElement($item);
    }
597969
public function setItem(\Wucdbm\Bundle\MenuBuilderBundle\Entity\MenuItem $item) {
        $this->item = $item;

        return $this;
    }
895398
public function remove($item)
    {
        if (!($item instanceof $this->dataClass)) {
            throw new InvalidArgumentException("ManyManyList::remove() expecting a $this->dataClass object");
        }

        return $this->removeByID($item->ID);
    }
1223247
public function removeItem($item)
    {
        if (!$item instanceof LineItem) {
            throw new ValidationException(_t(
                "ShoppingCart.WrongItemClass",
                "Item needs to be of class {class}",
                ["class" => LineItem::class]
            ));
        }

        $item->delete();
        $this->save();

        return $this;
    }
945644
public function remove ($item) {
        if (!$this->getConnection ()->getClient ()->srem ($this->name , $item)) {
            return false;
        }
        $this->_data = null;
        $this->_count = null;
        return true;
    }