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
8 
15 {
21  protected $_template = 'Magento_Reports::report/wishlist.phtml';
22 
28  protected $_wishlistFactory;
29 
37  public function __construct(
38  \Magento\Backend\Block\Template\Context $context,
39  \Magento\Reports\Model\ResourceModel\Wishlist\CollectionFactory $wishlistFactory,
40  array $data = []
41  ) {
42  $this->_wishlistFactory = $wishlistFactory;
43  parent::__construct($context, $data);
44  }
45 
49  protected function _beforeToHtml()
50  {
51  $this->setChild(
52  'grid',
53  $this->getLayout()->createBlock(\Magento\Reports\Block\Adminhtml\Wishlist\Grid::class, 'report.grid')
54  );
55 
56  $collection = $this->_wishlistFactory->create();
57 
58  list($customerWithWishlist, $wishlistsCount) = $collection->getWishlistCustomerCount();
59  $this->setCustomerWithWishlist($customerWithWishlist);
60  $this->setWishlistsCount($wishlistsCount);
61  $this->setItemsBought(0);
62  $this->setSharedCount($collection->getSharedCount());
63  $this->setReferralsCount(0);
64  $this->setConversionsCount(0);
65 
66  return $this;
67  }
68 }
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Reports\Model\ResourceModel\Wishlist\CollectionFactory $wishlistFactory, array $data=[])
Definition: Wishlist.php:37