Get parcelshops from either
- A parcelshop number
- A danish zipcode
- Nearby an address
- Or get all parcelshops in Denmark
<?php
require 'vendor/autoload.php';
use Lsv\GlsDk\ParcelShop;
$p = new ParcelShop();
$shop = $p->getParcelshop( ID );
Throws Exceptions\ParcelNotFoundException
if not found
Returns $shop
is a Entity\Parcelshop
object
<?php
require 'vendor/autoload.php';
use Lsv\GlsDk\ParcelShop;
$p = new ParcelShop();
$shops = $p->getParcelshopsFromZipcode( ZIPCODE );
Throws Exceptions\NoParcelsFoundInZipcodeException
if none found
Returns $shops
is a array of Entity\Parcelshop
<?php
require 'vendor/autoload.php';
use Lsv\GlsDk\ParcelShop;
$p = new ParcelShop();
$shops = $p->getParcelshopsNearAddress( STREET , ZIPCODE, 20 );
Third argument is how many you want
Throws Exceptions\MalformedAddressException
if address is unknown
Returns $shops
is a array of Entity\Parcelshop
<?php
require 'vendor/autoload.php';
use Lsv\GlsDk\ParcelShop;
$p = new ParcelShop();
$shops = $p->getAllParcelshops();
Returns $shops
is a array of Entity\Parcelshop
First install it with composer
composer require guzzlehttp/retry-subscriber
Now create our client
<?php
require 'vendor/autoload.php';
use Lsv\GlsDk\ParcelShop;
use GuzzleHttp\Subscriber\Retry\RetrySubscriber;
$retry = new RetrySubscriber([
'filter' => RetrySubscriber::createStatusFilter()
]);
$client = new GuzzleHttp\Client();
$client->getEmitter()->attach($retry);
$p = new ParcelShop($client);
$shops = $p->getAllParcelshops();
<?php
require 'vendor/autoload.php';
use Lsv\GlsDk\ParcelShop;
$p = new ParcelShop(null, 'url-to-webservice');
$shops = $p->getAllParcelshops();