<?php
declare(strict_types=1);
namespace App\Component\ExternalIntegration\Integration\Carerix\Subscriber;
use App\Component\ExternalIntegration\Integration\Carerix\Carerix;
use App\Component\ExternalIntegration\Manager\ExternalIntegrationManager;
use App\Event\SettingsSavedEvent;
use App\Form\Setting\CarerixSettingType;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class SettingSubscriber implements EventSubscriberInterface
{
public function __construct(protected readonly ExternalIntegrationManager $externalIntegrationManager)
{
}
public function onSettingsSaved(SettingsSavedEvent $event): void
{
if (CarerixSettingType::class !== \get_class($event->getType())) {
return;
}
$this->externalIntegrationManager->resetVacancyHashes(Carerix::getReference());
}
public static function getSubscribedEvents(): array
{
return [
SettingsSavedEvent::class => 'onSettingsSaved',
];
}
}