Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Rss Class Reference
Inheritance diagram for Rss:
Data AbstractHelper

Public Member Functions

 __construct (\Magento\Framework\App\Helper\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Data\Helper\PostHelper $postDataHelper, \Magento\Customer\Helper\View $customerViewHelper, \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerFactory, \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository)
 
 getWishlist ()
 
 getCustomer ()
 
 isRssAllow ()
 
- Public Member Functions inherited from Data
 __construct (\Magento\Framework\App\Helper\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Data\Helper\PostHelper $postDataHelper, \Magento\Customer\Helper\View $customerViewHelper, WishlistProviderInterface $wishlistProvider, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository)
 
 setCustomer (\Magento\Customer\Api\Data\CustomerInterface $customer)
 
 getCustomer ()
 
 getWishlist ()
 
 getItemCount ()
 
 getWishlistItemCollection ()
 
 getRemoveParams ($item, $addReferer=false)
 
 getConfigureUrl ($item)
 
 getAddParams ($item, array $params=[])
 
 getMoveFromCartParams ($itemId)
 
 getUpdateParams ($item)
 
 getAddToCartUrl ($item)
 
 getAddToCartParams ($item, $addReferer=false)
 
 addRefererToParams (array $params)
 
 getSharedAddToCartUrl ($item)
 
 getSharedAddAllToCartUrl ()
 
 getListUrl ($wishlistId=null)
 
 isAllow ()
 
 isAllowInCart ()
 
 getCustomerName ()
 
 getRssUrl ($wishlistId=null)
 
 defaultCommentString ()
 
 getDefaultWishlistName ()
 
 calculate ()
 
 isDisplayQty ()
 
 getProductUrl ($item, $additional=[])
 
- Public Member Functions inherited from AbstractHelper
 __construct (Context $context)
 
 isModuleOutputEnabled ($moduleName=null)
 

Protected Attributes

 $_customer
 
 $_customerFactory
 
 $_customerRepository
 
- Protected Attributes inherited from Data
 $_currentCustomer
 
 $_wishlist
 
 $_productCollection
 
 $_wishlistItemCollection
 
 $_coreRegistry
 
 $_customerSession
 
 $_wishlistFactory
 
 $_storeManager
 
 $_postDataHelper
 
 $_customerViewHelper
 
 $wishlistProvider
 
 $productRepository
 
- Protected Attributes inherited from AbstractHelper
 $_moduleName
 
 $_request
 
 $_moduleManager
 
 $_logger
 
 $_urlBuilder
 
 $_httpHeader
 
 $_eventManager
 
 $_remoteAddress
 
 $urlEncoder
 
 $urlDecoder
 
 $scopeConfig
 
 $_cacheConfig
 

Additional Inherited Members

- Data Fields inherited from Data
const XML_PATH_WISHLIST_LINK_USE_QTY = 'wishlist/wishlist_link/use_qty'
 
const XML_PATH_CATALOGINVENTORY_SHOW_OUT_OF_STOCK = 'cataloginventory/options/show_out_of_stock'
 
- Protected Member Functions inherited from Data
 _isCustomerLogIn ()
 
 _getCurrentCustomer ()
 
 _createWishlistItemCollection ()
 
 _getUrlStore ($item)
 
 _getCartUrlParameters ($item)
 
- Protected Member Functions inherited from AbstractHelper
 _getRequest ()
 
 _getModuleName ()
 
 _getUrl ($route, $params=[])
 

Detailed Description

@SuppressWarnings(PHPMD.CouplingBetweenObjects)

@api

Since
100.0.2

Definition at line 15 of file Rss.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\App\Helper\Context  $context,
\Magento\Framework\Registry  $coreRegistry,
\Magento\Customer\Model\Session  $customerSession,
\Magento\Wishlist\Model\WishlistFactory  $wishlistFactory,
\Magento\Store\Model\StoreManagerInterface  $storeManager,
\Magento\Framework\Data\Helper\PostHelper  $postDataHelper,
\Magento\Customer\Helper\View  $customerViewHelper,
\Magento\Wishlist\Controller\WishlistProviderInterface  $wishlistProvider,
\Magento\Catalog\Api\ProductRepositoryInterface  $productRepository,
\Magento\Customer\Api\Data\CustomerInterfaceFactory  $customerFactory,
\Magento\Customer\Api\CustomerRepositoryInterface  $customerRepository 
)
Parameters
\Magento\Framework\App\Helper\Context$context
\Magento\Framework\Registry$coreRegistry
\Magento\Customer\Model\Session$customerSession
\Magento\Wishlist\Model\WishlistFactory$wishlistFactory
\Magento\Store\Model\StoreManagerInterface$storeManager
\Magento\Framework\Data\Helper\PostHelper$postDataHelper
\Magento\Customer\Helper\View$customerViewHelper
\Magento\Wishlist\Controller\WishlistProviderInterface$wishlistProvider
\Magento\Catalog\Api\ProductRepositoryInterface$productRepository
\Magento\Customer\Api\Data\CustomerInterfaceFactory$customerFactory
\Magento\Customer\Api\CustomerRepositoryInterface$customerRepository@SuppressWarnings(PHPMD.ExcessiveParameterList)

Definition at line 46 of file Rss.php.

58  {
59  $this->_customerFactory = $customerFactory;
60  $this->_customerRepository = $customerRepository;
61 
62  parent::__construct(
63  $context,
64  $coreRegistry,
65  $customerSession,
66  $wishlistFactory,
68  $postDataHelper,
69  $customerViewHelper,
72  );
73  }
$storeManager
$customerRepository

Member Function Documentation

◆ getCustomer()

getCustomer ( )

Retrieve Customer instance

Returns
\Magento\Customer\Api\Data\CustomerInterface

Definition at line 102 of file Rss.php.

103  {
104  if ($this->_customer === null) {
105  $params = $this->urlDecoder->decode($this->_getRequest()->getParam('data'));
106  $data = explode(',', $params);
107  $customerId = abs(intval($data[0]));
108  if ($customerId && ($customerId == $this->_customerSession->getCustomerId())) {
109  $this->_customer = $this->_customerRepository->getById($customerId);
110  } else {
111  $this->_customer = $this->_customerFactory->create();
112  }
113  }
114 
115  return $this->_customer;
116  }
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18

◆ getWishlist()

getWishlist ( )

Retrieve Wishlist model

Returns
\Magento\Wishlist\Model\Wishlist

Definition at line 80 of file Rss.php.

81  {
82  if ($this->_wishlist === null) {
83  $this->_wishlist = $this->_wishlistFactory->create();
84 
85  $wishlistId = $this->_getRequest()->getParam('wishlist_id');
86  if ($wishlistId) {
87  $this->_wishlist->load($wishlistId);
88  } else {
89  if ($this->getCustomer()->getId()) {
90  $this->_wishlist->loadByCustomerId($this->getCustomer()->getId());
91  }
92  }
93  }
94  return $this->_wishlist;
95  }

◆ isRssAllow()

isRssAllow ( )

Is allow RSS

Returns
bool

Definition at line 123 of file Rss.php.

124  {
125  return $this->_moduleManager->isEnabled('Magento_Rss')
126  && $this->scopeConfig->isSetFlag(
127  'rss/wishlist/active',
128  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
129  );
130  }

Field Documentation

◆ $_customer

$_customer
protected

Definition at line 20 of file Rss.php.

◆ $_customerFactory

$_customerFactory
protected

Definition at line 25 of file Rss.php.

◆ $_customerRepository

$_customerRepository
protected

Definition at line 30 of file Rss.php.


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