Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/LocationClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,13 @@ public function getLocation(ComplexTypes\GetLocationRequest $getLocations)
{
return $this->__soapCall('GetLocation', [$getLocations]);
}

/**
* @param ComplexTypes\GetNearestLocationsRequest $getLocationsInArea
* @return ComplexTypes\GetLocationsResult
*/
public function getLocationsInArea(ComplexTypes\GetLocationsInAreaRequest $getLocationsInArea)
{
return $this->__soapCall('GetLocationsInArea', [$getLocationsInArea]);
}
}
34 changes: 34 additions & 0 deletions src/Postnl.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,40 @@ public function getNearestLocation(
$request = new ComplexTypes\GetNearestLocationsRequest($message, $location, $countryCode);
return $this->call('LocationClient', __FUNCTION__, $request);
}

/**
* @param ComplexTypes\Coordinate $coordinatesNorthWest
* @param ComplexTypes\Coordinate $coordinatesSouthEast
* @param string $allowSundaySorting
* @param null|string $deliveryDate
* @param array $deliveryOptions
* @param array $options
* @param string $countryCode
* @return ComplexTypes\GetNearestLocationsResponse
*/
public function getLocationsInArea(
ComplexTypes\Coordinate $coordinatesNorthWest,
ComplexTypes\Coordinate $coordinatesSouthEast,
$allowSundaySorting = 'false',
Comment thread
BBrunekreeft marked this conversation as resolved.
$deliveryDate = null,
$deliveryOptions = null,
$options = ['Daytime'],
$countryCode = 'NL'
) {
$message = new ComplexTypes\Message;

$deliveryDate = $deliveryDate ?: (new \DateTime('next monday'))->format('d-m-Y');
$locationArea = ComplexTypes\LocationArea::create()
->setAllowSundaySorting($allowSundaySorting)
->setDeliveryDate($deliveryDate)
->setDeliveryOptions($deliveryOptions)
->setOptions($options)
->setCoordinatesNorthWest($coordinatesNorthWest)
->setCoordinatesSouthEast($coordinatesSouthEast);

$request = new ComplexTypes\GetLocationsInAreaRequest($countryCode, $locationArea, $message);
return $this->call('LocationClient', __FUNCTION__, $request);
}

/**
* @param string $postalCode
Expand Down