Skip to main content

Validations and Log Messages

Shopware Import

Validations

In the Shopware import module, it is possible to check the completeness of a data record using the method validateEntry. See 01_Register_New_Module

Additional Log Messages

Within the Shopware import module, the logger can also be used within the 'store' method to log other relevant information.

use Psr\Log\LogLevel;
use Twocream\Core\Core\Framework\MessageQueue\Report\Message;

$this->report->addMessage(
new Message(LogLevel::WARNING, sprintf(
'Name should not be empty (ID: "%s", Language: "%s")',
$entry['id'],
$language
), $entry['id'])
);

$this->report->addMessage(
new Message(LogLevel::WARNING, sprintf(
'Item is not available in Shopware (ID: "%s", Shopware-Type: "%s")',
$readableId,
$entityName
), $contextId)
);