AfterbuyXMLService
in package
implements
LoggerAwareInterface
Interfaces, Classes and Traits
- LoggerAwareInterface
Table of Contents
- BASE_URI = 'https://api.afterbuy.de/afterbuy/ABInterface.aspx'
- LOGGING_NAMESPACE = 'afterbuy'
- $accountToken : mixed
- $apiTimeout : float
- $logger : LoggerInterface
- $partnerToken : mixed
- $productMapper : AfterbuyProductMapper
- __construct() : mixed
- arrayIsList() : bool
- arrayToXML() : string
- getAfterbuyDatetime() : DateTimeImmutable
- Retrieves server time from Afterbuy and returns it as a DateTimeImmutable instance.
- getProducts() : SimpleXMLElement
- Retrieves products from Afterbuy by their ProductIDs.
- getShopCatalogs() : array<string|int, mixed>
- Returns Afterbuy catalogs
- getShopProductsModifiedSince() : array<string|int, mixed>
- getShopProductsModifiedSinceRange() : array<string|int, mixed>
- performCall() : SimpleXMLElement
- Performs a call to Afterbuy’s XML API.
- setLogger() : mixed
- parseXMLResponse() : SimpleXMLElement
Constants
BASE_URI
private
mixed
BASE_URI
= 'https://api.afterbuy.de/afterbuy/ABInterface.aspx'
LOGGING_NAMESPACE
private
mixed
LOGGING_NAMESPACE
= 'afterbuy'
Properties
$accountToken
private
mixed
$accountToken
$apiTimeout
private
float
$apiTimeout
= 10.0
$logger
private
LoggerInterface
$logger
$partnerToken
private
mixed
$partnerToken
$productMapper
private
AfterbuyProductMapper
$productMapper
Methods
__construct()
public
__construct(string $partnerToken, string $accountToken) : mixed
Parameters
- $partnerToken : string
- $accountToken : string
Return values
mixed —arrayIsList()
public
static arrayIsList(array<string|int, mixed> $input) : bool
Parameters
- $input : array<string|int, mixed>
Return values
bool —arrayToXML()
public
static arrayToXML(array<string|int, mixed> $input, int $indent[, string $indentChar = ' ' ]) : string
Parameters
- $input : array<string|int, mixed>
- $indent : int
- $indentChar : string = ' '
Return values
string —getAfterbuyDatetime()
Retrieves server time from Afterbuy and returns it as a DateTimeImmutable instance.
public
getAfterbuyDatetime() : DateTimeImmutable
Tags
Return values
DateTimeImmutable —getProducts()
Retrieves products from Afterbuy by their ProductIDs.
public
getProducts(int ...$productIDs) : SimpleXMLElement
Parameters
- $productIDs : int
Tags
Return values
SimpleXMLElement —getShopCatalogs()
Returns Afterbuy catalogs
public
getShopCatalogs([bool $includeProducts = false ]) : array<string|int, mixed>
Parameters
- $includeProducts : bool = false
Tags
Return values
array<string|int, mixed> —getShopProductsModifiedSince()
public
getShopProductsModifiedSince(DateTimeInterface $startDate) : array<string|int, mixed>
Parameters
- $startDate : DateTimeInterface
Return values
array<string|int, mixed> —getShopProductsModifiedSinceRange()
public
getShopProductsModifiedSinceRange(DateTimeInterface $startDate[, int $maxShopItems = 100 ], int $lastProductId[, bool $useLastSaleOrStockChange = false ][, int|null $page = null ]) : array<string|int, mixed>
Parameters
- $startDate : DateTimeInterface
- $maxShopItems : int = 100
- $lastProductId : int
- $useLastSaleOrStockChange : bool = false
- $page : int|null = null
Tags
Return values
array<string|int, mixed> —performCall()
Performs a call to Afterbuy’s XML API.
public
performCall(string $callName[, array<string|int, mixed> $callData = [] ][, array<string|int, mixed> $additionalGlobal = [] ]) : SimpleXMLElement
Parameters
- $callName : string
- $callData : array<string|int, mixed> = []
- $additionalGlobal : array<string|int, mixed> = []
Tags
Return values
SimpleXMLElement —setLogger()
public
setLogger(LoggerInterface $logger) : mixed
Parameters
- $logger : LoggerInterface
Return values
mixed —parseXMLResponse()
private
static parseXMLResponse(string $responseBody) : SimpleXMLElement
Parameters
- $responseBody : string