<?php
declare(strict_types=1);

namespace App\DataPersister\Organization;

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

/**
 * Ccustom dataPersister gérant la resource Subdomain
 */
class SubdomainDataPersister extends EntityDataPersister
{
    #[Pure]
    public function __construct(
        OnSubdomainChange $onChange
    ) {
        parent::__construct($onChange);
    }

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