Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Wishlist.php
Go to the documentation of this file.
1 <?php
7 
9 {
15  public function execute()
16  {
18  $itemId = (int)$this->getRequest()->getParam('delete');
19  if ($customerId && $itemId) {
20  try {
21  $this->_objectManager->create(\Magento\Wishlist\Model\Item::class)->load($itemId)->delete();
22  } catch (\Exception $exception) {
23  $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($exception);
24  }
25  }
26 
27  $resultLayout = $this->resultLayoutFactory->create();
28  return $resultLayout;
29  }
30 }