Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Comment.php
Go to the documentation of this file.
1 <?php
7 
11 
13 {
19  protected $_invoice;
20 
24  protected $_storeManager;
25 
37  public function __construct(
38  \Magento\Framework\Model\Context $context,
39  \Magento\Framework\Registry $registry,
40  \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
43  \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
44  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
45  array $data = []
46  ) {
47  parent::__construct(
48  $context,
49  $registry,
50  $extensionFactory,
52  $resource,
53  $resourceCollection,
54  $data
55  );
56  $this->_storeManager = $storeManager;
57  }
58 
64  protected function _construct()
65  {
66  $this->_init(\Magento\Sales\Model\ResourceModel\Order\Invoice\Comment::class);
67  }
68 
75  public function setInvoice(\Magento\Sales\Model\Order\Invoice $invoice)
76  {
77  $this->_invoice = $invoice;
78  return $this;
79  }
80 
86  public function getInvoice()
87  {
88  return $this->_invoice;
89  }
90 
96  public function getStore()
97  {
98  if ($this->getInvoice()) {
99  return $this->getInvoice()->getStore();
100  }
101  return $this->_storeManager->getStore();
102  }
103 
109  public function getComment()
110  {
112  }
113 
119  public function getCreatedAt()
120  {
122  }
123 
127  public function setCreatedAt($createdAt)
128  {
129  return $this->setData(InvoiceCommentInterface::CREATED_AT, $createdAt);
130  }
131 
137  public function getIsCustomerNotified()
138  {
140  }
141 
147  public function getIsVisibleOnFront()
148  {
150  }
151 
157  public function getParentId()
158  {
160  }
161 
162  //@codeCoverageIgnoreStart
163 
167  public function setParentId($id)
168  {
170  }
171 
175  public function setIsCustomerNotified($isCustomerNotified)
176  {
177  return $this->setData(InvoiceCommentInterface::IS_CUSTOMER_NOTIFIED, $isCustomerNotified);
178  }
179 
183  public function setIsVisibleOnFront($isVisibleOnFront)
184  {
185  return $this->setData(InvoiceCommentInterface::IS_VISIBLE_ON_FRONT, $isVisibleOnFront);
186  }
187 
191  public function setComment($comment)
192  {
193  return $this->setData(InvoiceCommentInterface::COMMENT, $comment);
194  }
195 
201  public function getExtensionAttributes()
202  {
203  return $this->_getExtensionAttributes();
204  }
205 
212  public function setExtensionAttributes(
213  \Magento\Sales\Api\Data\InvoiceCommentExtensionInterface $extensionAttributes
214  ) {
215  return $this->_setExtensionAttributes($extensionAttributes);
216  }
217 
218  //@codeCoverageIgnoreEnd
219 }
$id
Definition: fieldset.phtml:14
setIsCustomerNotified($isCustomerNotified)
Definition: Comment.php:175
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
$storeManager
$resource
Definition: bulk.php:12
$invoice
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
Definition: Comment.php:37
setExtensionAttributes(\Magento\Sales\Api\Data\InvoiceCommentExtensionInterface $extensionAttributes)
Definition: Comment.php:212
setInvoice(\Magento\Sales\Model\Order\Invoice $invoice)
Definition: Comment.php:75