Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Data Fields | |
const | STATUS_NEW = 1 |
const | REPORT_DATE_TYPE_ORDER_CREATED = 'order_created' |
const | REPORT_DATE_TYPE_SHIPMENT_CREATED = 'shipment_created' |
const | XML_PATH_STORE_ADDRESS1 = 'shipping/origin/street_line1' |
const | XML_PATH_STORE_ADDRESS2 = 'shipping/origin/street_line2' |
const | XML_PATH_STORE_CITY = 'shipping/origin/city' |
const | XML_PATH_STORE_REGION_ID = 'shipping/origin/region_id' |
const | XML_PATH_STORE_ZIP = 'shipping/origin/postcode' |
const | XML_PATH_STORE_COUNTRY_ID = 'shipping/origin/country_id' |
![]() | |
const | CUSTOM_ATTRIBUTES = 'custom_attributes' |
![]() | |
const | EXTENSION_ATTRIBUTES_KEY = 'extension_attributes' |
![]() | |
const | ENTITY_ID = 'entity_id' |
const | STORE_ID = 'store_id' |
const | TOTAL_WEIGHT = 'total_weight' |
const | TOTAL_QTY = 'total_qty' |
const | EMAIL_SENT = 'email_sent' |
const | ORDER_ID = 'order_id' |
const | CUSTOMER_ID = 'customer_id' |
const | SHIPPING_ADDRESS_ID = 'shipping_address_id' |
const | BILLING_ADDRESS_ID = 'billing_address_id' |
const | SHIPMENT_STATUS = 'shipment_status' |
const | INCREMENT_ID = 'increment_id' |
const | CREATED_AT = 'created_at' |
const | UPDATED_AT = 'updated_at' |
const | PACKAGES = 'packages' |
const | SHIPPING_LABEL = 'shipping_label' |
const | ITEMS = 'items' |
const | TRACKS = 'tracks' |
const | COMMENTS = 'comments' |
Protected Member Functions | |
_construct () | |
![]() | |
filterCustomAttributes ($data) | |
initializeCustomAttributes () | |
convertCustomAttributeValues (array &$customAttributes) | |
getCustomAttributesCodes () | |
_setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes) | |
_getExtensionAttributes () | |
![]() | |
_construct () | |
_init ($resourceModel) | |
_setResourceModel ($resourceName, $collectionName=null) | |
_getResource () | |
_getEventData () | |
_beforeLoad ($modelId, $field=null) | |
_afterLoad () | |
_hasModelChanged () | |
_getValidatorBeforeSave () | |
_createValidatorBeforeSave () | |
_getValidationRulesBeforeSave () | |
_clearReferences () | |
_clearData () | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Protected Attributes | |
$entityType = 'shipment' | |
$_order | |
$_eventPrefix = 'sales_order_shipment' | |
$_eventObject = 'shipment' | |
$_shipmentItemCollectionFactory | |
$_trackCollectionFactory | |
$_commentFactory | |
$_commentCollectionFactory | |
$orderRepository | |
![]() | |
$extensionAttributesFactory | |
$extensionAttributes | |
$customAttributeFactory | |
$customAttributesCodes = null | |
$customAttributesChanged = false | |
![]() | |
$_eventPrefix = 'core_abstract' | |
$_eventObject = 'object' | |
$_idFieldName = 'id' | |
$_hasDataChanges = false | |
$_origData | |
$_isDeleted = false | |
$_resource | |
$_resourceCollection | |
$_resourceName | |
$_collectionName | |
$_cacheTag = false | |
$_dataSaveAllowed = true | |
$_isObjectNew = null | |
$_validatorBeforeSave = null | |
$_eventManager | |
$_cacheManager | |
$_registry | |
$_logger | |
$_appState | |
$_actionValidator | |
$storedData = [] | |
![]() | |
$_data = [] | |
Additional Inherited Members | |
![]() | |
static | $_underscoreCache = [] |
Sales order shipment model
@api @method \Magento\Sales\Model\Order\Invoice setSendEmail(bool $value) @method \Magento\Sales\Model\Order\Invoice setCustomerNote(string $value) @method string getCustomerNote() @method \Magento\Sales\Model\Order\Invoice setCustomerNoteNotify(bool $value) @method bool getCustomerNoteNotify() @SuppressWarnings(PHPMD.CouplingBetweenObjects) @SuppressWarnings(PHPMD.ExcessivePublicCount)
Definition at line 27 of file Shipment.php.
__construct | ( | \Magento\Framework\Model\Context | $context, |
\Magento\Framework\Registry | $registry, | ||
\Magento\Framework\Api\ExtensionAttributesFactory | $extensionFactory, | ||
AttributeValueFactory | $customAttributeFactory, | ||
\Magento\Sales\Model\ResourceModel\Order\Shipment\Item\CollectionFactory | $shipmentItemCollectionFactory, | ||
\Magento\Sales\Model\ResourceModel\Order\Shipment\Track\CollectionFactory | $trackCollectionFactory, | ||
\Magento\Sales\Model\Order\Shipment\CommentFactory | $commentFactory, | ||
\Magento\Sales\Model\ResourceModel\Order\Shipment\Comment\CollectionFactory | $commentCollectionFactory, | ||
\Magento\Sales\Api\OrderRepositoryInterface | $orderRepository, | ||
\Magento\Framework\Model\ResourceModel\AbstractResource | $resource = null , |
||
\Magento\Framework\Data\Collection\AbstractDb | $resourceCollection = null , |
||
array | $data = [] |
||
) |
\Magento\Framework\Model\Context | $context | |
\Magento\Framework\Registry | $registry | |
\Magento\Framework\Api\ExtensionAttributesFactory | $extensionFactory | |
AttributeValueFactory | $customAttributeFactory | |
\Magento\Sales\Model\ResourceModel\Order\Shipment\Item\CollectionFactory | $shipmentItemCollectionFactory | |
\Magento\Sales\Model\ResourceModel\Order\Shipment\Track\CollectionFactory | $trackCollectionFactory | |
Shipment\CommentFactory | $commentFactory | |
\Magento\Sales\Model\ResourceModel\Order\Shipment\Comment\CollectionFactory | $commentCollectionFactory | |
\Magento\Sales\Api\OrderRepositoryInterface | $orderRepository | |
\Magento\Framework\Model\ResourceModel\AbstractResource | $resource | |
\Magento\Framework\Data\Collection\AbstractDb | $resourceCollection | |
array | $data | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 122 of file Shipment.php.
|
protected |
Adds comment to shipment with option to send it to customer via email and show it in customer account
\Magento\Sales\Model\Order\Shipment\Comment | string | $comment | |
bool | $notify | |
bool | $visibleOnFront |
Definition at line 433 of file Shipment.php.
addItem | ( | \Magento\Sales\Model\Order\Shipment\Item | $item | ) |
Adds an item to the shipment
\Magento\Sales\Model\Order\Shipment\Item | $item |
Definition at line 337 of file Shipment.php.
addTrack | ( | \Magento\Sales\Model\Order\Shipment\Track | $track | ) |
Addes a track to the collection and associates the shipment to the track
\Magento\Sales\Model\Order\Shipment\Track | $track |
Track saving is implemented in _afterSave() This enforces \Magento\Framework\Model\AbstractModel::save() not to skip _afterSave()
Definition at line 401 of file Shipment.php.
getAllItems | ( | ) |
Retrieves all non-deleted items from the shipment
Definition at line 304 of file Shipment.php.
getAllTracks | ( | ) |
Retrieves all available tracks in the collection that aren't deleted
Definition at line 368 of file Shipment.php.
getBillingAddress | ( | ) |
getBillingAddressId | ( | ) |
Returns billing_address_id
Implements ShipmentInterface.
Definition at line 616 of file Shipment.php.
getComments | ( | ) |
Returns comments
Implements ShipmentInterface.
Definition at line 734 of file Shipment.php.
getCommentsCollection | ( | $reload = false | ) |
Retrieves comments collection.
bool | $reload |
Definition at line 460 of file Shipment.php.
getCreatedAt | ( | ) |
Returns created_at
Implements ShipmentInterface.
Definition at line 626 of file Shipment.php.
getCustomerId | ( | ) |
Returns customer_id
Implements ShipmentInterface.
Definition at line 644 of file Shipment.php.
getEmailSent | ( | ) |
Returns email_sent
Implements ShipmentInterface.
Definition at line 654 of file Shipment.php.
getEntityType | ( | ) |
Return order history item identifier
@codeCoverageIgnore
Definition at line 222 of file Shipment.php.
getExtensionAttributes | ( | ) |
Retrieve existing extension attributes object or create a new one.
Implements ShipmentInterface.
Definition at line 856 of file Shipment.php.
getIncrementId | ( | ) |
Returns increment id
@codeCoverageIgnore
Implements ShipmentInterface.
Definition at line 520 of file Shipment.php.
getItemById | ( | $itemId | ) |
Retrieves an item from the shipment using its ID
string | int | $itemId |
Definition at line 321 of file Shipment.php.
getItems | ( | ) |
Returns items
Implements ShipmentInterface.
Definition at line 551 of file Shipment.php.
getItemsCollection | ( | ) |
Retrieves the collection used to track the shipment's items
Definition at line 284 of file Shipment.php.
getOrder | ( | ) |
Retrieve the order the shipment for created for
Definition at line 207 of file Shipment.php.
getOrderId | ( | ) |
Returns order_id
Implements ShipmentInterface.
Definition at line 664 of file Shipment.php.
getPackages | ( | ) |
Returns packages
@codeCoverageIgnore
Implements ShipmentInterface.
Definition at line 532 of file Shipment.php.
getProtectCode | ( | ) |
getShipmentStatus | ( | ) |
Returns shipment_status
Implements ShipmentInterface.
Definition at line 674 of file Shipment.php.
getShippingAddress | ( | ) |
getShippingAddressId | ( | ) |
Returns shipping_address_id
Implements ShipmentInterface.
Definition at line 684 of file Shipment.php.
getShippingLabel | ( | ) |
Get shipping label and decode by db adapter
Implements ShipmentInterface.
Definition at line 504 of file Shipment.php.
getStore | ( | ) |
Retrieve store model instance
Definition at line 482 of file Shipment.php.
getStoreId | ( | ) |
Returns store_id
Implements ShipmentInterface.
Definition at line 694 of file Shipment.php.
getTotalQty | ( | ) |
Returns total_qty
Implements ShipmentInterface.
Definition at line 704 of file Shipment.php.
getTotalWeight | ( | ) |
Returns total_weight
Implements ShipmentInterface.
Definition at line 714 of file Shipment.php.
getTrackById | ( | $trackId | ) |
Retrieves a track using its ID
string | int | $trackId |
Definition at line 385 of file Shipment.php.
getTracks | ( | ) |
Returns tracks
Implements ShipmentInterface.
Definition at line 587 of file Shipment.php.
getTracksCollection | ( | ) |
Retrieve tracks collection.
Definition at line 354 of file Shipment.php.
getUpdatedAt | ( | ) |
Returns updated_at
Implements ShipmentInterface.
Definition at line 724 of file Shipment.php.
loadByIncrementId | ( | $incrementId | ) |
Load shipment by increment id
string | $incrementId |
Definition at line 168 of file Shipment.php.
setBillingAddressId | ( | $id | ) |
Sets the billing address ID for the shipment.
int | $id |
Implements ShipmentInterface.
Definition at line 822 of file Shipment.php.
setComments | ( | $comments = null | ) |
Sets comments
Implements ShipmentInterface.
Definition at line 758 of file Shipment.php.
setCreatedAt | ( | $createdAt | ) |
Sets the created-at timestamp for the shipment.
string | $createdAt | timestamp |
Implements ShipmentInterface.
Definition at line 634 of file Shipment.php.
setCustomerId | ( | $id | ) |
Sets the customer ID for the shipment.
int | $id |
Implements ShipmentInterface.
Definition at line 806 of file Shipment.php.
setEmailSent | ( | $emailSent | ) |
Sets the email-sent flag value for the shipment.
int | $emailSent |
Implements ShipmentInterface.
Definition at line 790 of file Shipment.php.
setExtensionAttributes | ( | \Magento\Sales\Api\Data\ShipmentExtensionInterface | $extensionAttributes | ) |
\Magento\Sales\Api\Data\ShipmentExtensionInterface | $extensionAttributes |
Definition at line 867 of file Shipment.php.
setIncrementId | ( | $id | ) |
Sets the increment ID for the shipment.
string | $id |
Implements ShipmentInterface.
Definition at line 838 of file Shipment.php.
setItems | ( | $items | ) |
Sets items
@codeCoverageIgnore
mixed | $items |
Implements ShipmentInterface.
Definition at line 577 of file Shipment.php.
setOrder | ( | \Magento\Sales\Model\Order | $order | ) |
Declare order for shipment
\Magento\Sales\Model\Order | $order |
Definition at line 185 of file Shipment.php.
setOrderId | ( | $id | ) |
Sets the order ID for the shipment.
int | $id |
Implements ShipmentInterface.
Definition at line 798 of file Shipment.php.
setPackages | ( | array | $packages = null | ) |
Sets any packages for the shipment.
Implements ShipmentInterface.
Definition at line 541 of file Shipment.php.
setShipmentStatus | ( | $shipmentStatus | ) |
Sets the shipment status.
int | $shipmentStatus |
Implements ShipmentInterface.
Definition at line 830 of file Shipment.php.
setShippingAddressId | ( | $id | ) |
Sets the shipping address ID for the shipment.
int | $id |
Implements ShipmentInterface.
Definition at line 814 of file Shipment.php.
setShippingLabel | ( | $label | ) |
Set shipping label
string | $label | label representation (image or pdf file) |
Implements ShipmentInterface.
Definition at line 493 of file Shipment.php.
setStoreId | ( | $id | ) |
Sets the store ID for the shipment.
int | $id |
Implements ShipmentInterface.
Definition at line 766 of file Shipment.php.
setTotalQty | ( | $qty | ) |
Sets the total quantity for the shipment.
float | $qty |
Implements ShipmentInterface.
Definition at line 782 of file Shipment.php.
setTotalWeight | ( | $totalWeight | ) |
Sets the total weight for the shipment.
float | $totalWeight |
Implements ShipmentInterface.
Definition at line 774 of file Shipment.php.
setTracks | ( | $tracks | ) |
Returns tracks
Implements ShipmentInterface.
Definition at line 606 of file Shipment.php.
setUpdatedAt | ( | $timestamp | ) |
Sets the updated-at timestamp for the shipment.
string | $timestamp |
Implements ShipmentInterface.
Definition at line 846 of file Shipment.php.
|
protected |
Definition at line 90 of file Shipment.php.
|
protected |
Definition at line 85 of file Shipment.php.
|
protected |
Definition at line 70 of file Shipment.php.
|
protected |
Definition at line 65 of file Shipment.php.
|
protected |
Definition at line 60 of file Shipment.php.
|
protected |
Definition at line 75 of file Shipment.php.
|
protected |
Definition at line 80 of file Shipment.php.
|
protected |
Definition at line 55 of file Shipment.php.
|
protected |
Definition at line 95 of file Shipment.php.
const REPORT_DATE_TYPE_ORDER_CREATED = 'order_created' |
Definition at line 31 of file Shipment.php.
const REPORT_DATE_TYPE_SHIPMENT_CREATED = 'shipment_created' |
Definition at line 33 of file Shipment.php.
const STATUS_NEW = 1 |
Definition at line 29 of file Shipment.php.
const XML_PATH_STORE_ADDRESS1 = 'shipping/origin/street_line1' |
Store address
Definition at line 38 of file Shipment.php.
const XML_PATH_STORE_ADDRESS2 = 'shipping/origin/street_line2' |
Definition at line 40 of file Shipment.php.
const XML_PATH_STORE_CITY = 'shipping/origin/city' |
Definition at line 42 of file Shipment.php.
const XML_PATH_STORE_COUNTRY_ID = 'shipping/origin/country_id' |
Definition at line 48 of file Shipment.php.
const XML_PATH_STORE_REGION_ID = 'shipping/origin/region_id' |
Definition at line 44 of file Shipment.php.
const XML_PATH_STORE_ZIP = 'shipping/origin/postcode' |
Definition at line 46 of file Shipment.php.