/** * @return string */ protected function getLinkParams() { $params = []; $wishlistId = $this->wishlistHelper->getWishlist()->getId(); $customer = $this->wishlistHelper->getCustomer(); if ($customer) { $key = $customer->getId() . ',' . $customer->getEmail(); $params = ['type' => 'wishlist', 'data' => $this->urlEncoder->encode($key), '_secure' => false]; } if ($wishlistId) { $params['wishlist_id'] = $wishlistId; } return $params; }
/** * Retrieve block cache tags * * @return array */ public function getIdentities() { /** @var $wishlist \Magento\Wishlist\Model\Wishlist */ $wishlist = $this->_wishlistHelper->getWishlist(); $identities = $wishlist->getIdentities(); foreach ($wishlist->getItemCollection() as $item) { /** @var $item \Magento\Wishlist\Model\Item */ $identities = array_merge($identities, $item->getProduct()->getIdentities()); } return $identities; }
/** * Retrieve current wishlist * * @return \Magento\Wishlist\Model\Wishlist */ public function getWishlist() { return $this->_wishlistData->getWishlist(); }
public function testGetWishlistWithCoreRegistry() { $wishlist = $this->getMock('\\Magento\\Wishlist\\Model\\Wishlist', [], [], '', false); $this->coreRegistry->expects($this->any())->method('registry')->will($this->returnValue($wishlist)); $this->assertEquals($wishlist, $this->wishlistHelper->getWishlist()); }
public function testGetWishlistWithCoreRegistry() { $this->coreRegistry->expects($this->any())->method('registry')->willReturn($this->wishlist); $this->assertEquals($this->wishlist, $this->model->getWishlist()); }
/** * Retrieve Wishlist model * * @return \Magento\Wishlist\Model\Wishlist */ protected function getWishlist() { $wishlist = $this->wishlistHelper->getWishlist(); return $wishlist; }