Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Price.php
Go to the documentation of this file.
1 <?php
7 
9 
36 {
41 
50  public function __construct(
51  \Magento\Framework\Model\Context $context,
52  \Magento\Framework\Registry $registry,
53  \Magento\ProductAlert\Model\ResourceModel\Price\Customer\CollectionFactory $customerColFactory,
54  \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
55  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
56  array $data = []
57  ) {
58  $this->_customerColFactory = $customerColFactory;
59  parent::__construct($context, $registry, $resource, $resourceCollection, $data);
60  }
61 
65  protected function _construct()
66  {
67  $this->_init(\Magento\ProductAlert\Model\ResourceModel\Price::class);
68  }
69 
73  public function getCustomerCollection()
74  {
75  return $this->_customerColFactory->create();
76  }
77 
81  public function loadByParam()
82  {
83  if ($this->getProductId() !== null && $this->getCustomerId() !== null && $this->getWebsiteId() !== null) {
84  $this->getResource()->loadByParam($this);
85  }
86  return $this;
87  }
88 
94  public function deleteCustomer($customerId, $websiteId = 0)
95  {
96  $this->getResource()->deleteCustomer($this, $customerId, $websiteId);
97  return $this;
98  }
99 }
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\ProductAlert\Model\ResourceModel\Price\Customer\CollectionFactory $customerColFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
Definition: Price.php:50
$resource
Definition: bulk.php:12
deleteCustomer($customerId, $websiteId=0)
Definition: Price.php:94