Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Wishlist Class Reference
Inheritance diagram for Wishlist:
Index Action AbstractAction Action AbstractAction ActionInterface

Public Member Functions

 execute ()
 
- Public Member Functions inherited from Index
 __construct (\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Customer\Model\AddressFactory $addressFactory, \Magento\Customer\Model\Metadata\FormFactory $formFactory, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, \Magento\Customer\Helper\View $viewHelper, \Magento\Framework\Math\Random $random, CustomerRepositoryInterface $customerRepository, \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter, Mapper $addressMapper, AccountManagementInterface $customerAccountManagement, AddressRepositoryInterface $addressRepository, CustomerInterfaceFactory $customerDataFactory, AddressInterfaceFactory $addressDataFactory, \Magento\Customer\Model\Customer\Mapper $customerMapper, \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, DataObjectHelper $dataObjectHelper, ObjectFactory $objectFactory, \Magento\Framework\View\LayoutFactory $layoutFactory, \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory, \Magento\Framework\View\Result\PageFactory $resultPageFactory, \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory)
 
- Public Member Functions inherited from AbstractAction
 __construct (Action\Context $context)
 
 dispatch (\Magento\Framework\App\RequestInterface $request)
 
 _processUrlKeys ()
 
 getUrl ($route='', $params=[])
 
- Public Member Functions inherited from Action
 __construct (Context $context)
 
 dispatch (RequestInterface $request)
 
 getActionFlag ()
 
- Public Member Functions inherited from AbstractAction
 __construct (Context $context)
 
 dispatch (RequestInterface $request)
 
 getRequest ()
 
 getResponse ()
 

Additional Inherited Members

- Data Fields inherited from Index
const ADMIN_RESOURCE = 'Magento_Customer::manage'
 
- Data Fields inherited from AbstractAction
const FLAG_IS_URLS_CHECKED = 'check_url_settings'
 
const SESSION_NAMESPACE = 'adminhtml'
 
const ADMIN_RESOURCE = 'Magento_Backend::admin'
 
- Data Fields inherited from ActionInterface
const FLAG_NO_DISPATCH = 'no-dispatch'
 
const FLAG_NO_POST_DISPATCH = 'no-postDispatch'
 
const FLAG_NO_DISPATCH_BLOCK_EVENT = 'no-beforeGenerateLayoutBlocksDispatch'
 
const PARAM_NAME_BASE64_URL = 'r64'
 
const PARAM_NAME_URL_ENCODED = 'uenc'
 
- Protected Member Functions inherited from Index
 initCurrentCustomer ()
 
 prepareDefaultCustomerTitle (\Magento\Backend\Model\View\Result\Page $resultPage)
 
 _addSessionErrorMessages ($messages)
 
 actUponMultipleCustomers (callable $singleAction, $customerIds)
 
- Protected Member Functions inherited from AbstractAction
 _isAllowed ()
 
 _getSession ()
 
 getMessageManager ()
 
 _addBreadcrumb ($label, $title, $link=null)
 
 _addContent (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _addLeft (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _addJs (\Magento\Framework\View\Element\AbstractBlock $block)
 
 _isUrlChecked ()
 
 _processLocaleSettings ()
 
 _redirect ($path, $arguments=[])
 
 _forward ($action, $controller=null, $module=null, array $params=null)
 
 _validateSecretKey ()
 
- Protected Member Functions inherited from Action
 _forward ($action, $controller=null, $module=null, array $params=null)
 
 _redirect ($path, $arguments=[])
 
- Protected Attributes inherited from Index
 $_validator
 
 $_coreRegistry = null
 
 $_fileFactory
 
 $_customerFactory = null
 
 $_addressFactory = null
 
 $_subscriberFactory
 
 $_formFactory
 
 $_customerRepository
 
 $_viewHelper
 
 $_random
 
 $_objectFactory
 
 $_extensibleDataObjectConverter
 
 $addressMapper
 
 $customerAccountManagement
 
 $addressRepository
 
 $customerDataFactory
 
 $addressDataFactory
 
 $customerMapper
 
 $dataObjectProcessor
 
 $dataObjectHelper
 
 $layoutFactory
 
 $resultLayoutFactory
 
 $resultPageFactory
 
 $resultForwardFactory
 
 $resultJsonFactory
 
- Protected Attributes inherited from AbstractAction
 $_publicActions = []
 
 $_sessionNamespace = self::SESSION_NAMESPACE
 
 $_helper
 
 $_session
 
 $_authorization
 
 $_auth
 
 $_backendUrl
 
 $_localeResolver
 
 $_canUseBaseUrl
 
 $_formKeyValidator
 
- Protected Attributes inherited from Action
 $_objectManager
 
 $_sessionNamespace
 
 $_eventManager
 
 $_actionFlag
 
 $_redirect
 
 $_view
 
 $_url
 
 $messageManager
 
- Protected Attributes inherited from AbstractAction
 $_request
 
 $_response
 
 $resultRedirectFactory
 
 $resultFactory
 

Detailed Description

Definition at line 8 of file Wishlist.php.

Member Function Documentation

◆ execute()

execute ( )

Wishlist Action

Returns
\Magento\Framework\View\Result\Layout

Implements ActionInterface.

Definition at line 15 of file Wishlist.php.

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  }

The documentation for this class was generated from the following file: