Last active
April 21, 2017 14:20
-
-
Save styks1987/437f16e1fd290832eff28e171e46ef15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$shipmentPackagesResponses = $verifyShipment->getPackages(); | |
$shipmentPackages = $shipment->shipment_packages; | |
foreach($shipmentPackages as $key => &$shipmentPackage){ | |
$shipmentPackage = $shipmentPackage->toArray(); | |
$shipmentPackage['tracking_code'] = $shipmentPackagesResponses[$key]->getTrackingCode(); | |
} | |
$shipment = $this->Shipments->patchEntity($shipment, ['shipment_packages' => $shipmentPackages], [ | |
'associated' => ['ShipmentPackages'] | |
]); | |
$this->Shipments->save($shipment, [ | |
'associated' => ['ShipmentPackages'] | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment