code: public function onPreDelete(ResourceEventInterface $event)
      {
          $item = $this->getSupplierDeliveryItemFromEvent($event);
  
          $this->assertDeletable($item);
  
          // Initialize the supplier deliveries's items collection before the item removal.
          if (null !== $delivery = $item->getDelivery()) {
              $delivery->getItems();
          }
      }
docs: Pre delete event handler.
  
  @param ResourceEventInterface $event