Skip to content

Commit

Permalink
update version to v2.1.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardPerdaan committed Mar 29, 2019
1 parent bd52eb5 commit 243003a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Tests/SendConsignments/SendMuliColoConsignmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public function testMultiColo()

$this->assertNotEquals($consignments[0]->getMyParcelConsignmentId(), $consignments[1]->getMyParcelConsignmentId());
$this->assertNotEquals($consignments[0]->getBarcode(), $consignments[1]->getBarcode());
$this->assertTrue($consignments[0]->isPartOfMultiCollo());
$this->assertTrue($consignments[1]->isPartOfMultiCollo());
}
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "myparcelnl/sdk",
"version": "v2.1.0-beta.2",
"version": "v2.1.0-beta.3",
"description": "This package is designed to send and receive data from MyParcel by means of an API.",
"homepage": "https://www.myparcel.nl",
"tags": ["MyParcel", "My Parcel", "Flespakket", "Post NL", "PostNL"],
Expand Down
7 changes: 4 additions & 3 deletions src/Helper/MyParcelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,13 +604,14 @@ private function getNewCollectionFromResult($result)
}

$consignmentAdapter = new ConsignmentAdapter($shipment, $consignments->first()->getApiKey());
$newCollection->addConsignment($consignmentAdapter->getConsignment());
$isMultiCollo = ! empty($shipment['secondary_shipments']);
$newCollection->addConsignment($consignmentAdapter->getConsignment()->setMultiCollo($isMultiCollo));

foreach ($shipment['secondary_shipments'] as $secondaryShipment) {

$secondaryShipment = Arr::arrayMergeRecursiveDistinct($shipment, $secondaryShipment);
$secondaryShipment = Arr::arrayMergeRecursiveDistinct($shipment, $secondaryShipment);
$consignmentAdapter = new ConsignmentAdapter($secondaryShipment, $this->getConsignmentsByReferenceId($secondaryShipment['reference_identifier']));
$newCollection->addConsignment($consignmentAdapter->getConsignment());
$newCollection->addConsignment($consignmentAdapter->getConsignment()->setMultiCollo($isMultiCollo));

}
}
Expand Down
6 changes: 4 additions & 2 deletions src/Model/MyParcelConsignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,13 @@ public function setApiKey($apiKey)
}

/**
* @param bool $value
*
* @return MyParcelConsignment
*/
public function setMultiCollo()
public function setMultiCollo($value = true)
{
$this->partOfMultiCollo = true;
$this->partOfMultiCollo = $value;

return $this;
}
Expand Down

0 comments on commit 243003a

Please sign in to comment.