Item remove event handler.

@param OrderItemEvent $event
763376
public function onRemove(OrderItemEvent $event)
    {
        $order = $event->getOrder();
        $item  = $event->getItem();

        $order->removeItem($item);
    }
1085591
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof RoutableBehavior) {
            return;
        }

        $locales = $this->documentInspector->getLocales($document);
        foreach ($locales as $locale) {
            $localizedDocument = $this->documentManager->find($document->getUuid(), $locale);

            $route = $this->routeRepository->findByEntity(
                $localizedDocument->getClass(),
                $localizedDocument->getUuid(),
                $locale
            );
            if (!$route) {
                continue;
            }

            $this->entityManager->remove($route);

            if ($document instanceof ChildrenBehavior) {
                $this->removeChildRoutes($document, $locale);
            }
        }

        $this->entityManager->flush();
    }
544443
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if (!$document instanceof RouteBehavior) {
            return;
        }

        $this->recursivelyRemoveRoutes($document);
    }
877564
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();
        if (!($document instanceof CustomUrlBehavior)) {
            return;
        }

        foreach ($this->inspector->getReferrers($document) as $referrer) {
            if ($referrer instanceof RouteBehavior) {
                $this->documentManager->remove($referrer);
            }
        }
    }
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";
    }
275522
public function preRemove(Item $item, LifecycleEventArgs $event)
    {
        $interaction = $item->getInteraction();
        if (null !== $interaction) {
            $event->getEntityManager()->remove($interaction);
        }
    }
137006
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof PageBehavior) {
            return;
        }

        $page = 1;
        foreach ($document->getParent()->getChildren() as $child) {
            if (!$child instanceof PageBehavior || $child->getUuid() === $document->getUuid()) {
                continue;
            }

            $childNode = $this->documentInspector->getNode($child);
            $childNode->setProperty($this->propertyEncoder->systemName(static::FIELD), ++$page);
        }
    }
70080
protected function removeItem(Model $item)
    {
        $this->beforeRemove($item);

        $success = $item->delete();

        if ($success) {
            $this->afterRemove($item);
        }

        return $success;
    }
544188
protected function removeItemAddressesThatAreEqualToOrderAddress($order)
    {
        $deliveryAddressId = $order->getDeliveryAddress()->getContactAddress()->getId();
        foreach ($order->getItems() as $item) {
            $itemEntity = $item->getEntity();
            $this->removeOrderAddressIfContactAddressIdIsEqualTo($itemEntity, $deliveryAddressId);
        }
    }
1028526
public function removeLineItem(\HarvestCloud\CoreBundle\Entity\Payment\PaymentLineItem $lineItem)
    {
        $this->lineItems->removeElement($lineItem);
    }
512181
public function forget($event)
    {
        if (mb_strpos($event, '*') !== false) {
            unset($this->wildcards[$event]);
        } else {
            unset($this->listeners[$event], $this->sorted[$event]);
        }
    }
566530
public function removeEventHandler($eventName, $eventHandlerName, $priority = 50)
    {
        $this->removeHandler(self::EVENT, $eventName, $eventHandlerName, $priority);
    }
606619
function removeThis()
    {
        $itemOptionList = eZProductCollectionItemOption::fetchList( $this->attribute( 'id' ) );

        $db = eZDB::instance();
        $db->begin();
        foreach( $itemOptionList as $itemOption )
        {
            $itemOption->remove();
        }
        $this->remove();
        $db->commit();
    }
1256370
public function handleRemoveLive($event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticleDocument) {
            return;
        }

        $this->liveIndexer->remove($document);
        $this->liveIndexer->flush();
    }
634888
public function handleReorder(ReorderEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof RoutablePageBehavior || !$document instanceof ParentBehavior) {
            return;
        }

        $parentDocument = $document->getParent();
        if (!$parentDocument instanceof ChildrenBehavior) {
            return;
        }

        $locale = $this->documentInspector->getLocale($parentDocument);
        $propertyName = $this->getRoutePathPropertyName($parentDocument->getStructureType(), $locale);
        foreach ($parentDocument->getChildren() as $childDocument) {
            $node = $this->documentInspector->getNode($childDocument);

            $route = $this->chainRouteGenerator->generate($childDocument);
            $childDocument->setRoutePath($route->getPath());

            $node->setProperty($propertyName, $route->getPath());
        }
    }
821996
public function remove(EventInterface $event)
    {
        foreach ($this->events as $key => $internalEvent) {
            if ($event->getUid() === $internalEvent->getUid()) {
                unset($this->events[$key]);
            }
        }
    }
1157920
public function deleteItemAction(Item $item) {
        $em = $this->getDoctrine()->getManager();
        $em->remove($item);
        $em->flush();

        $view = $this->view();

        return $this->handleView($view);
    }