OrderIdMappingWriter
in package
Class OrderIdMappingWriter
Table of Contents
- ERROR_INTEGRITY_VIOLATION = 'Integrity constraint violation'
- $connection : Connection
- __construct() : mixed
- OrderIdMappingWriter constructor.
- save() : void
- Saves the afterbuy order id mapping in the 'afterbuy_orders' table.
- enhanceErrorMessage() : string
- Enhances error messages by appending useful information from the current context to the given message.
- isIntegrityConstraintViolation() : bool
- Checks if error message contains integrity constraint violation in the error message.
- throwAlreadyMappedException() : void
- Throws an `AfterbuyOrderIdConstraintViolationException` containing useful information about what went wrong.
Constants
ERROR_INTEGRITY_VIOLATION
private
mixed
ERROR_INTEGRITY_VIOLATION
= 'Integrity constraint violation'
Properties
$connection
private
Connection
$connection
Methods
__construct()
OrderIdMappingWriter constructor.
public
__construct(Connection $connection) : mixed
Parameters
- $connection : Connection
Return values
mixed —save()
Saves the afterbuy order id mapping in the 'afterbuy_orders' table.
public
save(AfterbuyOrderIdMapping $orderIdMapping, string $xmlResponse) : void
Parameters
- $orderIdMapping : AfterbuyOrderIdMapping
- $xmlResponse : string
Tags
Return values
void —enhanceErrorMessage()
Enhances error messages by appending useful information from the current context to the given message.
private
enhanceErrorMessage(string $message, string $xmlResponse, string $errorMessage, AfterbuyOrderIdMapping $orderIdMapping) : string
Returns the enhanced error message, containing the Afterbuy- and Shop order id and additionally the XML-Response of the Afterbuy Shop-API call.
Parameters
- $message : string
- $xmlResponse : string
- $errorMessage : string
- $orderIdMapping : AfterbuyOrderIdMapping
Return values
string —isIntegrityConstraintViolation()
Checks if error message contains integrity constraint violation in the error message.
private
isIntegrityConstraintViolation(string $errorMessage) : bool
Parameters
- $errorMessage : string
Return values
bool —throwAlreadyMappedException()
Throws an `AfterbuyOrderIdConstraintViolationException` containing useful information about what went wrong.
private
throwAlreadyMappedException(string $errorMessage, string $xmlResponse, AfterbuyOrderIdMapping $orderIdMapping) : void
Parameters
- $errorMessage : string
- $xmlResponse : string
- $orderIdMapping : AfterbuyOrderIdMapping