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 
17 {
23  protected $_creditmemo;
24 
28  protected $_storeManager;
29 
41  public function __construct(
42  \Magento\Framework\Model\Context $context,
43  \Magento\Framework\Registry $registry,
44  \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
47  \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
48  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
49  array $data = []
50  ) {
51  parent::__construct(
52  $context,
53  $registry,
54  $extensionFactory,
56  $resource,
57  $resourceCollection,
58  $data
59  );
60  $this->_storeManager = $storeManager;
61  }
62 
68  protected function _construct()
69  {
70  $this->_init(\Magento\Sales\Model\ResourceModel\Order\Creditmemo\Comment::class);
71  }
72 
81  public function setCreditmemo(\Magento\Sales\Model\Order\Creditmemo $creditmemo)
82  {
83  $this->_creditmemo = $creditmemo;
84  return $this;
85  }
86 
94  public function getCreditmemo()
95  {
96  return $this->_creditmemo;
97  }
98 
104  public function getStore()
105  {
106  if ($this->getCreditmemo()) {
107  return $this->getCreditmemo()->getStore();
108  }
109  return $this->_storeManager->getStore();
110  }
111 
112  //@codeCoverageIgnoreStart
113 
119  public function getComment()
120  {
122  }
123 
129  public function getCreatedAt()
130  {
132  }
133 
137  public function setCreatedAt($createdAt)
138  {
139  return $this->setData(CreditmemoCommentInterface::CREATED_AT, $createdAt);
140  }
141 
147  public function getIsCustomerNotified()
148  {
150  }
151 
157  public function getIsVisibleOnFront()
158  {
160  }
161 
167  public function getParentId()
168  {
170  }
171 
175  public function setParentId($id)
176  {
178  }
179 
183  public function setIsCustomerNotified($isCustomerNotified)
184  {
185  return $this->setData(CreditmemoCommentInterface::IS_CUSTOMER_NOTIFIED, $isCustomerNotified);
186  }
187 
191  public function setIsVisibleOnFront($isVisibleOnFront)
192  {
193  return $this->setData(CreditmemoCommentInterface::IS_VISIBLE_ON_FRONT, $isVisibleOnFront);
194  }
195 
199  public function setComment($comment)
200  {
201  return $this->setData(CreditmemoCommentInterface::COMMENT, $comment);
202  }
203 
209  public function getExtensionAttributes()
210  {
211  return $this->_getExtensionAttributes();
212  }
213 
220  public function setExtensionAttributes(
221  \Magento\Sales\Api\Data\CreditmemoCommentExtensionInterface $extensionAttributes
222  ) {
223  return $this->_setExtensionAttributes($extensionAttributes);
224  }
225 
226  //@codeCoverageIgnoreEnd
227 }
__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:41
$id
Definition: fieldset.phtml:14
setCreditmemo(\Magento\Sales\Model\Order\Creditmemo $creditmemo)
Definition: Comment.php:81
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
$storeManager
$resource
Definition: bulk.php:12
setIsCustomerNotified($isCustomerNotified)
Definition: Comment.php:183
setExtensionAttributes(\Magento\Sales\Api\Data\CreditmemoCommentExtensionInterface $extensionAttributes)
Definition: Comment.php:220