Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-sales
Model
Order
Invoice
Comment.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Sales\Model\Order\Invoice
;
7
8
use
Magento\Framework\Api\AttributeValueFactory
;
9
use
Magento\Sales\Api\Data\InvoiceCommentInterface
;
10
use
Magento\Sales\Model\AbstractModel
;
11
12
class
Comment
extends
AbstractModel
implements
InvoiceCommentInterface
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,
41
AttributeValueFactory
$customAttributeFactory
,
42
\
Magento
\Store\Model\
StoreManagerInterface
$storeManager
,
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,
51
$customAttributeFactory
,
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
{
111
return
$this->
getData
(
InvoiceCommentInterface::COMMENT
);
112
}
113
119
public
function
getCreatedAt
()
120
{
121
return
$this->
getData
(
InvoiceCommentInterface::CREATED_AT
);
122
}
123
127
public
function
setCreatedAt
($createdAt)
128
{
129
return
$this->
setData
(
InvoiceCommentInterface::CREATED_AT
, $createdAt);
130
}
131
137
public
function
getIsCustomerNotified
()
138
{
139
return
$this->
getData
(
InvoiceCommentInterface::IS_CUSTOMER_NOTIFIED
);
140
}
141
147
public
function
getIsVisibleOnFront
()
148
{
149
return
$this->
getData
(
InvoiceCommentInterface::IS_VISIBLE_ON_FRONT
);
150
}
151
157
public
function
getParentId
()
158
{
159
return
$this->
getData
(
InvoiceCommentInterface::PARENT_ID
);
160
}
161
162
//@codeCoverageIgnoreStart
163
167
public
function
setParentId
(
$id
)
168
{
169
return
$this->
setData
(
InvoiceCommentInterface::PARENT_ID
,
$id
);
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
}
Magento\Sales\Api\Data\CommentInterface\COMMENT
const COMMENT
Definition:
CommentInterface.php:24
Magento\Sales\Model\Order
Definition:
Order.php:54
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\Framework\Model\AbstractExtensibleModel\_getExtensionAttributes
_getExtensionAttributes()
Definition:
AbstractExtensibleModel.php:340
Magento\Sales\Api\Data\InvoiceCommentInterface
Definition:
InvoiceCommentInterface.php:18
Magento\Sales\Model\Order\Invoice
Definition:
Invoice.php:25
$id
$id
Definition:
fieldset.phtml:14
Magento\Sales\Model\Order\Invoice\Comment\setIsCustomerNotified
setIsCustomerNotified($isCustomerNotified)
Definition:
Comment.php:175
Magento\Framework\Model\AbstractExtensibleModel\_setExtensionAttributes
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
Definition:
AbstractExtensibleModel.php:329
$storeManager
$storeManager
Definition:
paypal_quote.php:14
$resource
$resource
Definition:
bulk.php:12
Magento\Sales\Model\Order\Invoice\Comment\$_storeManager
$_storeManager
Definition:
Comment.php:24
Magento\Framework\Model\AbstractExtensibleModel\$extensionAttributes
$extensionAttributes
Definition:
AbstractExtensibleModel.php:30
Magento\Sales\Model\Order\Invoice\Comment\getStore
getStore()
Definition:
Comment.php:96
Magento\Framework\Model\AbstractExtensibleModel\$customAttributeFactory
$customAttributeFactory
Definition:
AbstractExtensibleModel.php:35
Magento\Sales\Api\Data\CommentInterface\IS_VISIBLE_ON_FRONT
const IS_VISIBLE_ON_FRONT
Definition:
CommentInterface.php:19
Magento\Framework\Data\Collection\AbstractDb
Definition:
AbstractDb.php:23
Magento\Sales\Api\Data\EntityInterface\CREATED_AT
const CREATED_AT
Definition:
EntityInterface.php:23
Magento\Sales\Model\Order\Invoice\Comment\setCreatedAt
setCreatedAt($createdAt)
Definition:
Comment.php:127
$registry
$registry
Definition:
bundle_product_with_not_visible_children_rollback.php:16
Magento\Sales\Api\Data\InvoiceCommentInterface\IS_CUSTOMER_NOTIFIED
const IS_CUSTOMER_NOTIFIED
Definition:
InvoiceCommentInterface.php:30
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Sales\Model\Order\Invoice\Comment\setParentId
setParentId($id)
Definition:
Comment.php:167
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Sales\Model\Order\Invoice\Comment\_construct
_construct()
Definition:
Comment.php:64
Magento\Sales\Model\Order\Invoice\Comment\setIsVisibleOnFront
setIsVisibleOnFront($isVisibleOnFront)
Definition:
Comment.php:183
Magento\Sales\Model\Order\Invoice\Comment\getIsVisibleOnFront
getIsVisibleOnFront()
Definition:
Comment.php:147
$invoice
$invoice
Definition:
partial_invoice.php:22
Magento\Payment\Helper\Data
Definition:
Data.php:25
Magento\Sales\Model\Order\Invoice\Comment
Definition:
Comment.php:12
Magento\Framework\Api\AttributeValueFactory
Definition:
AttributeValueFactory.php:12
Magento\Sales\Model\Order\Invoice
Magento\Sales\Model\Order\Invoice\Comment\getComment
getComment()
Definition:
Comment.php:109
Magento
Magento\Framework\Model\AbstractExtensibleModel\getData
getData($key='', $index=null)
Definition:
AbstractExtensibleModel.php:247
Magento\Sales\Model\Order\Invoice\Comment\$_invoice
$_invoice
Definition:
Comment.php:19
Magento\Framework\Data\Collection
Definition:
Collection.php:19
Magento\Framework\Model\AbstractExtensibleModel\setData
setData($key, $value=null)
Definition:
AbstractExtensibleModel.php:189
Magento\Sales\Model\Order\Invoice\Comment\setComment
setComment($comment)
Definition:
Comment.php:191
Magento\Sales\Model\Order\Invoice\Comment\getIsCustomerNotified
getIsCustomerNotified()
Definition:
Comment.php:137
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Sales\Model\Order\Invoice\Comment\getParentId
getParentId()
Definition:
Comment.php:157
Magento\Sales\Model\Order\Invoice\Comment\__construct
__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
Magento\Sales\Model\Order\Invoice\Comment\setExtensionAttributes
setExtensionAttributes(\Magento\Sales\Api\Data\InvoiceCommentExtensionInterface $extensionAttributes)
Definition:
Comment.php:212
Magento\Sales\Api\Data\InvoiceCommentInterface\PARENT_ID
const PARENT_ID
Definition:
InvoiceCommentInterface.php:26
Magento\Sales\Model\Order\Invoice\Comment\getInvoice
getInvoice()
Definition:
Comment.php:86
Magento\Sales\Model\Order\Invoice\Comment\getExtensionAttributes
getExtensionAttributes()
Definition:
Comment.php:201
Magento\Sales\Model\Order\Invoice\Comment\getCreatedAt
getCreatedAt()
Definition:
Comment.php:119
Magento\Sales\Model\Order\Invoice\Comment\setInvoice
setInvoice(\Magento\Sales\Model\Order\Invoice $invoice)
Definition:
Comment.php:75
Magento\Sales\Model\AbstractModel
Definition:
AbstractModel.php:19
Magento\Framework\Model\AbstractModel\_init
_init($resourceModel)
Definition:
AbstractModel.php:213