phpDocumentor

AfterbuyOrderTrackingRepository

Class AfterbuyOrderTrackingRepository

Table of Contents

CONFIGURATION_AB_TRACKING_SYNC  = 'last_tracking_sync'
DEFAULT_LANGUAGE_ID  = '2'
$languageService  : LanguageService
$logger  : AfterbuyLogger
$parcelServiceReadService  : ParcelServiceReadService
$reader  : AfterbuyOrderTrackingReader
$trackingCodeWriteService  : TrackingCodeWriteService
$writer  : AfterbuyOrderTrackingWriter
__construct()  : mixed
AfterbuyOrderTrackingRepository constructor.
findTrackingCodesByOrderId()  : AfterbuyOrderTrackingCodes
Returns a list of afterbuy tracking codes for the given order.
getAfterbuyTrackingSyncShippingMethods()  : array<string|int, mixed>
Returns a list of all afterbuy tracking link synchronization configurations.
getTrackingCodes()  : AfterbuyOrderTrackingCodes
Returns a list of order tracking codes from the Afterbuy XML-API.
orderExists()  : bool
Checks if an order exists for the tracking codes order id.
saveTrackingCode()  : void
createCode()  : void
Creates the tracking code and handles possible errors.
createTrackingCode()  : void
Creates a tracking code for the order.
getCurrentLanguage()  : Language
Returns the current shop language.
getParcelServiceFromKey()  : ParcelService
Returns a parcel service.
getThrowableContext()  : array<string|int, mixed>
Extracts context information from any throwable type, used for logging.

Constants

Properties

Methods

__construct()

AfterbuyOrderTrackingRepository constructor.

public __construct(AfterbuyOrderTrackingReader $reader, AfterbuyOrderTrackingWriter $writer, AfterbuyLogger $logger, TrackingCodeWriteService $trackingCodeWriteService, ParcelServiceReadService $parcelServiceReadService, LanguageService $languageService) : mixed
Parameters
$reader : AfterbuyOrderTrackingReader
$writer : AfterbuyOrderTrackingWriter
$logger : AfterbuyLogger
$trackingCodeWriteService : TrackingCodeWriteService
$parcelServiceReadService : ParcelServiceReadService
$languageService : LanguageService
Return values
mixed

findTrackingCodesByOrderId()

Returns a list of afterbuy tracking codes for the given order.

public findTrackingCodesByOrderId(OrderId $orderId) : AfterbuyOrderTrackingCodes

It is required to set up Afterbuy in the shop system, otherwise either an AfterbuyNotInstalledException or AfterbuyNotEnabledException exception is thrown.

Additionally, the method might throw an AfterbuyResponseException if the request to the Afterbuy XML-API fails for some reason.

Parameters
$orderId : OrderId
Tags
throws
AfterbuyNotInstalledException|AfterbuyNotEnabledException
throws
AfterbuyResponseException
Return values
AfterbuyOrderTrackingCodes

getAfterbuyTrackingSyncShippingMethods()

Returns a list of all afterbuy tracking link synchronization configurations.

public getAfterbuyTrackingSyncShippingMethods() : array<string|int, mixed>

When removing the prefix tracking_sync_shipping_methods_ from the array key, you get the parcel service provider id of the shop system. The result will be cached, so subsequent calls

Return values
array<string|int, mixed>

getTrackingCodes()

Returns a list of order tracking codes from the Afterbuy XML-API.

public getTrackingCodes(string $lastTrackingSync) : AfterbuyOrderTrackingCodes

It is required to set up Afterbuy in the shop system, otherwise either an AfterbuyNotInstalledException or AfterbuyNotEnabledException exception is thrown.

Additionally, the method might throw an AfterbuyResponseException if the request to the Afterbuy XML-API fails for some reason.

Parameters
$lastTrackingSync : string
Tags
throws
AfterbuyNotInstalledException|AfterbuyNotEnabledException
throws
AfterbuyResponseException
Return values
AfterbuyOrderTrackingCodes

getThrowableContext()

Extracts context information from any throwable type, used for logging.

private getThrowableContext(Throwable $t) : array<string|int, mixed>
Parameters
$t : Throwable
Return values
array<string|int, mixed>

Search results