yawik / SimpleImport

Simple Job Import Module. Imports job openings into YAWIK
MIT License
0 stars 1 forks source link

Add Listener for EntityEraser events. #43

Closed TiSiE closed 4 years ago

TiSiE commented 5 years ago

In yawik/jobs a EntityLoader for the purge cli command is implemented, which loads all jobs that are expired a certain amount of days. The purge command triggers an event to fetch dependent entities ( to a job entity )

SimpleImport needs a Listener for that events to report and remove the crawler items associated with an job.


An example dependency loader can be found in the yawik/Applications: LoadDependendEntities

which is registered in config:

'Core/EntityEraser/Dependencies/Events' => [
    'listeners' => [
        Listener\LoadDependendEntities::class => [
            'events' => [
                \Core\Service\EntityEraser\DependencyResultEvent::CHECK_DEPENDENCIES => '__invoke',
                \Core\Service\EntityEraser\DependencyResultEvent::DELETE             => 'onDelete',
            ],
        ],
    ],
]

the purge command to delete expired jobs can be triggered with:

bin/console purge expired-jobs
TiSiE commented 5 years ago

@kilip If you want you can work on this.