<?php
declare(strict_types=1);

namespace App\DataPersister\Organization;

use App\DataPersister\EntityDataPersister;
use App\Entity\Organization\Organization;
use App\Service\OnChange\Organization\OnOrganizationChange;
use JetBrains\PhpStorm\Pure;

/**
 * Classe OrganizationDataPersister qui est un custom dataPersister gérant la resource Organization
 */
class OrganizationDataPersister extends EntityDataPersister
{
    #[Pure]
    public function __construct(
        OnOrganizationChange $onChange
    )
    {
        parent::__construct($onChange);
    }

    public function supports($data, array $context = []): bool
    {
        return $data instanceof Organization;
    }
}
