fierce-agency-72925
12/07/2022, 10:21 AMeager-island-84229
12/08/2022, 9:42 AMgreat-byte-99546
12/08/2022, 10:25 AMadorable-wolf-29357
12/09/2022, 8:02 AMbillions-carpet-85832
12/09/2022, 8:37 AMfew-tomato-6859
12/09/2022, 10:55 AMspy_customer
but they don't seem to get triggered.
What I did was:
β’ add <behavior name="event">
with <parameter name="spy_customer_all" column="*"/>
to the schema.xml
β’ add Pyz/Zed/Customer/Dependency/CustomerEvents.php
with correct const names (in this case it's 'Entity.spy_customer.create'
)
β’ register my EventSubscriber in the EventDependencyProvider
and in the subscriber add my listener to the $eventCollection
β’ rebuild the schema files in src/Orm
and regenerate the Propel files
Did I miss anything?
What stumped me when debugging this was that after the saveEventBehaviorEntityChange
function triggered, there still was no enty in spy_event_behavior_entity_change
(even after any transactions were commited)gifted-processor-93179
12/09/2022, 11:25 AMgentle-art-90358
12/09/2022, 12:11 PMPyz
folder under src
? I'm asking because this factory is outside the traditional location (root of the module), and invoked by the main factory here, so that's why I'm a bit confused.
I hope that was clear enough. Any help would be greatly appreciated! πelegant-cartoon-61249
12/12/2022, 9:36 AMelegant-cartoon-61249
12/12/2022, 12:26 PMmost-policeman-66093
12/12/2022, 12:48 PMwonderful-baker-94910
12/12/2022, 1:00 PMfew-tomato-6859
12/12/2022, 1:01 PMwonderful-baker-94910
12/12/2022, 1:06 PMelegant-agent-58713
12/12/2022, 1:50 PMrough-agency-88294
12/13/2022, 8:12 AMcool-pager-36928
12/13/2022, 1:07 PMbusy-fish-98087
12/13/2022, 4:02 PMlate-tiger-76201
12/14/2022, 9:12 AMboundless-whale-69542
12/14/2022, 3:53 PMdocker/sdk up
hundreds-flower-81270
12/14/2022, 9:46 PMgifted-processor-93179
12/15/2022, 5:04 AMaverage-beach-7993
12/15/2022, 7:38 AMaverage-beach-7993
12/15/2022, 7:40 AMbreezy-architect-55847
12/15/2022, 8:40 AMcalm-toddler-60539
12/15/2022, 12:23 PMcalm-toddler-60539
12/15/2022, 12:53 PMcalm-toddler-60539
12/15/2022, 2:43 PMdocker/sdk console code:sniff:architecture src/Aep -v
The architecture code sniffer is still showing old violation errors although I have fixed them. Any hints how to fix this?calm-toddler-60539
12/15/2022, 4:03 PM/**
* @inheritDoc
*/
public function write(DataSetInterface $dataSet)
{
$this->setDataSetWriterPersistenceState(false);
$spyProductQuery = SpyProductAbstractQuery::create()
->filterBySku($dataSet[static::KEY_ATTRIBUTES])
->findOneOrCreate();
$spyProductQuery->setAttributes($dataSet[static::KEY_ATTRIBUTES]);
$spyProductQuery->setSku($dataSet[static::KEY_SKU]);
$spyProductQuery->save();
$spyProductLocalizedAttributesQuery = SpyProductLocalizedAttributesQuery::create()
->filterByfkproduct($spyProductQuery->getIdProductAbstract())
->findOneOrCreate();
$spyProductLocalizedAttributesQuery->setFkLocale(66);
$spyProductLocalizedAttributesQuery->setFkProduct($spyProductQuery->getIdProductAbstract());
$spyProductLocalizedAttributesQuery->setAttributes($dataSet[static::KEY_ATTRIBUTES]);
$spyProductLocalizedAttributesQuery->setDescription('placeholder description');
$spyProductLocalizedAttributesQuery->setName($dataSet[static::KEY_ATTRIBUTES]);
$spyProductLocalizedAttributesQuery->save();
}
When I run the import, I get the following error. Can someone please advise me what I might be doing wrong? The code up to $spyProductQuery->save();
is running file. Something after this is giving me the following error:
Starting import with /data/data/import/local/full_EU.yml configuration file.
Spryker\Zed\DataImport\Business\Exception\DataImportException - Exception: Unable to execute INSERT statement [INSERT INTO `spy_product_localized_attributes` (`id_product_attributes`, `fk_locale`, `fk_product`, `attributes`, `description`, `name`, `created_at`, `updated_at`) VALUES (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7)]
DataImport for "aep-import-abstract-product" at data set position "1" has an error.
For debugging execute "vendor/bin/console data:import:aep-import-abstract-product -o 1 -l 1 -t"
gentle-art-90358
12/16/2022, 11:00 AM