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
Shipment
Comment.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Sales\Model\Order\Shipment
;
7
8
use
Magento\Framework\Api\AttributeValueFactory
;
9
use
Magento\Sales\Api\Data\ShipmentCommentInterface
;
10
use
Magento\Sales\Model\AbstractModel
;
11
12
class
Comment
extends
AbstractModel
implements
ShipmentCommentInterface
13
{
19
protected
$_shipment
;
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
\
Shipment
\Comment::class);
67
}
68
77
public
function
setShipment
(\
Magento
\Sales\Model\
Order
\
Shipment
$shipment
)
78
{
79
$this->_shipment =
$shipment
;
80
return
$this;
81
}
82
90
public
function
getShipment
()
91
{
92
return
$this->_shipment
;
93
}
94
100
public
function
getStore
()
101
{
102
if
($this->
getShipment
()) {
103
return
$this->
getShipment
()->getStore();
104
}
105
return
$this->_storeManager->getStore();
106
}
107
108
//@codeCoverageIgnoreStart
109
115
public
function
getComment
()
116
{
117
return
$this->
getData
(
ShipmentCommentInterface::COMMENT
);
118
}
119
125
public
function
getCreatedAt
()
126
{
127
return
$this->
getData
(
ShipmentCommentInterface::CREATED_AT
);
128
}
129
133
public
function
setCreatedAt
($createdAt)
134
{
135
return
$this->
setData
(
ShipmentCommentInterface::CREATED_AT
, $createdAt);
136
}
137
143
public
function
getIsCustomerNotified
()
144
{
145
return
$this->
getData
(
ShipmentCommentInterface::IS_CUSTOMER_NOTIFIED
);
146
}
147
153
public
function
getIsVisibleOnFront
()
154
{
155
return
$this->
getData
(
ShipmentCommentInterface::IS_VISIBLE_ON_FRONT
);
156
}
157
163
public
function
getParentId
()
164
{
165
return
$this->
getData
(
ShipmentCommentInterface::PARENT_ID
);
166
}
167
171
public
function
setParentId
(
$id
)
172
{
173
return
$this->
setData
(
ShipmentCommentInterface::PARENT_ID
,
$id
);
174
}
175
179
public
function
setIsCustomerNotified
($isCustomerNotified)
180
{
181
return
$this->
setData
(
ShipmentCommentInterface::IS_CUSTOMER_NOTIFIED
, $isCustomerNotified);
182
}
183
187
public
function
setIsVisibleOnFront
($isVisibleOnFront)
188
{
189
return
$this->
setData
(
ShipmentCommentInterface::IS_VISIBLE_ON_FRONT
, $isVisibleOnFront);
190
}
191
195
public
function
setComment
($comment)
196
{
197
return
$this->
setData
(
ShipmentCommentInterface::COMMENT
, $comment);
198
}
199
205
public
function
getExtensionAttributes
()
206
{
207
return
$this->
_getExtensionAttributes
();
208
}
209
216
public
function
setExtensionAttributes
(
217
\
Magento
\Sales\Api\
Data
\ShipmentCommentExtensionInterface
$extensionAttributes
218
) {
219
return
$this->
_setExtensionAttributes
($extensionAttributes);
220
}
221
222
//@codeCoverageIgnoreEnd
223
}
Magento\Sales\Api\Data\ShipmentCommentInterface\IS_CUSTOMER_NOTIFIED
const IS_CUSTOMER_NOTIFIED
Definition:
ShipmentCommentInterface.php:30
Magento\Sales\Api\Data\CommentInterface\COMMENT
const COMMENT
Definition:
CommentInterface.php:24
Magento\Sales\Model\Order
Definition:
Order.php:54
Magento\Sales\Model\Order\Shipment\Comment\setExtensionAttributes
setExtensionAttributes(\Magento\Sales\Api\Data\ShipmentCommentExtensionInterface $extensionAttributes)
Definition:
Comment.php:216
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\Framework\Model\AbstractExtensibleModel\_getExtensionAttributes
_getExtensionAttributes()
Definition:
AbstractExtensibleModel.php:340
Magento\Sales\Model\Order\Shipment\Comment
Definition:
Comment.php:12
Magento\Sales\Model\Order\Shipment\Comment\getCreatedAt
getCreatedAt()
Definition:
Comment.php:125
Magento\Sales\Model\Order\Shipment\Comment\getComment
getComment()
Definition:
Comment.php:115
$id
$id
Definition:
fieldset.phtml:14
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\Shipment\Comment\_construct
_construct()
Definition:
Comment.php:64
Magento\Sales\Model\Order\Shipment\Comment\getStore
getStore()
Definition:
Comment.php:100
Magento\Sales\Model\Order\Shipment\Comment\$_shipment
$_shipment
Definition:
Comment.php:19
Magento\Framework\Model\AbstractExtensibleModel\$extensionAttributes
$extensionAttributes
Definition:
AbstractExtensibleModel.php:30
Magento\Sales\Model\Order\Shipment\Comment\getShipment
getShipment()
Definition:
Comment.php:90
Magento\Sales\Model\Order\Shipment\Comment\getIsCustomerNotified
getIsCustomerNotified()
Definition:
Comment.php:143
Magento\Sales\Model\Order\Shipment\Comment\setComment
setComment($comment)
Definition:
Comment.php:195
Magento\Sales\Model\Order\Shipment\Comment\setParentId
setParentId($id)
Definition:
Comment.php:171
Magento\Sales\Model\Order\Shipment\Comment\getIsVisibleOnFront
getIsVisibleOnFront()
Definition:
Comment.php:153
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\Sales\Model\Order\Shipment\Comment\setIsCustomerNotified
setIsCustomerNotified($isCustomerNotified)
Definition:
Comment.php:179
Magento\Framework\Data\Collection\AbstractDb
Definition:
AbstractDb.php:23
Magento\Sales\Api\Data\EntityInterface\CREATED_AT
const CREATED_AT
Definition:
EntityInterface.php:23
$registry
$registry
Definition:
bundle_product_with_not_visible_children_rollback.php:16
Magento\Sales\Model\Order\Shipment
Definition:
Shipment.php:27
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Sales\Model\Order\Shipment\Comment\setIsVisibleOnFront
setIsVisibleOnFront($isVisibleOnFront)
Definition:
Comment.php:187
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Sales\Model\Order\Shipment\Comment\getParentId
getParentId()
Definition:
Comment.php:163
Magento\Payment\Helper\Data
Definition:
Data.php:25
Magento\Framework\Api\AttributeValueFactory
Definition:
AttributeValueFactory.php:12
Magento\Sales\Model\Order\Shipment
Magento
Magento\Framework\Model\AbstractExtensibleModel\getData
getData($key='', $index=null)
Definition:
AbstractExtensibleModel.php:247
Magento\Framework\Data\Collection
Definition:
Collection.php:19
Magento\Sales\Model\Order\Shipment\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\Shipment\Comment\getExtensionAttributes
getExtensionAttributes()
Definition:
Comment.php:205
Magento\Framework\Model\AbstractExtensibleModel\setData
setData($key, $value=null)
Definition:
AbstractExtensibleModel.php:189
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Sales\Api\Data\ShipmentCommentInterface
Definition:
ShipmentCommentInterface.php:18
Magento\Sales\Model\Order\Shipment\Comment\$_storeManager
$_storeManager
Definition:
Comment.php:24
Magento\Sales\Model\Order\Shipment\Comment\setShipment
setShipment(\Magento\Sales\Model\Order\Shipment $shipment)
Definition:
Comment.php:77
$shipment
foreach($order->getItems() as $orderItem) $shipment
Definition:
order_with_shipping_and_invoice.php:46
Magento\Sales\Model\Order\Shipment\Comment\setCreatedAt
setCreatedAt($createdAt)
Definition:
Comment.php:133
Magento\Sales\Model\AbstractModel
Definition:
AbstractModel.php:19
Magento\Framework\Model\AbstractModel\_init
_init($resourceModel)
Definition:
AbstractModel.php:213
Magento\Sales\Api\Data\ShipmentCommentInterface\PARENT_ID
const PARENT_ID
Definition:
ShipmentCommentInterface.php:26