Common/EventListener/AbstractSaleItemListener.php
public function onDelete(ResourceEventInterface $event)
    {
        $item = $this->getSaleItemFromEvent($event);

        // Sale may be null here: if it is schedule for delete,
        // the persistence tracker won't be able to retrieve it.
        $sale = $this->getSaleFromItem($item);

        if (null !== $parent = $item->getParent()) {
            $parent->removeChild($item);
        } elseif (null !== $sale) {
            $sale->removeItem($item);
        }

        if (null !== $sale) {
            $this->scheduleSaleContentChangeEvent($sale);
        }
    }
public function onDelete(ResourceEventInterface $event)
    {
        $item = $this->getSaleItemFromEvent($event);

        // Sale may be null here: if it is schedule for delete,
        // the persistence tracker won't be able to retrieve it.
        $sale = $this->getSaleFromItem($item);

        if (null !== $parent = $item->getParent()) {
            $parent->removeChild($item);
        } elseif (null !== $sale) {
            $sale->removeItem($item);
        }

        if (null !== $sale) {
            $this->scheduleSaleContentChangeEvent($sale);
        }
    }
public function onDelete ( ResourceEventInterface $ event ) { $ item = $ this -> getSaleItemFromEvent ( $ event ) ; // Sale may be null here: if it is schedule for delete, // the persistence tracker won't be able to retrieve it. $ sale = $ this -> getSaleFromItem ( $ item ) ; if ( null !== $ parent = $ item -> getParent ( ) ) { $ parent -> removeChild ( $ item ) ; } elseif ( null !== $ sale ) { $ sale -> removeItem ( $ item ) ; } if ( null !== $ sale ) { $ this -> scheduleSaleContentChangeEvent ( $ sale ) ; } }
Delete event handler.

@param ResourceEventInterface $event
Delete event handler .