Skip to content

Commit

Permalink
update add-publish-events.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliiShveider committed Sep 10, 2024
1 parent 15fce7d commit aa22792
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,36 @@ class PublisherDependencyProvider extends SprykerPublisherDependencyProvider
}
```

5. If you need original values or additional data set in the `EventEntityTransfer`, provide configuration in Entity class.
`getOriginalValueColumnNames` called only on save event.
```php
<?php

...

namespace Orm\Zed\Glossary\Persistence;

use Orm\Zed\Glossary\Persistence\Map\SpyGlossaryTableMap;
use Spryker\Zed\Glossary\Persistence\Propel\AbstractSpyGlossary as BaseSpyGlossary;

class SpyGlossary extends BaseSpyGlossary
{
protected function getAdditionalValueColumnNames(): array
{
return [
SpyGlossaryTableMap::COL_IS_ACTIVE,
...
];
}

protected function getOriginalValueColumnNames(): array
{
return [
SpyGlossaryTableMap::COL_SOME_COLUMN,
...
];
}
}
```

Now, you can track the changes in the `Glossary` entity. When it is created, updated, or deleted, an event is created and posted to the specified RabbitMQ publish queue (`publish.translation`).

0 comments on commit aa22792

Please sign in to comment.