<?php

namespace App\Validator\Constraints;

use App\Model\OrganizationalUnitMulticastModes;
use App\Model\UserGroupPermissions;
use Symfony\Component\Validator\Constraint;

#[\Attribute]
class OrganizationalUnitMulticastMode extends Constraint
{
    private array $modes;
    public string $message;

    public function __construct(mixed $options = null, ?array $groups = null, mixed $payload = null)
    {
        parent::__construct($options, $groups, $payload);

        $this->modes = OrganizationalUnitMulticastModes::getMcastModes();
        $this->message = sprintf(
            'The multicast mode is not valid. Please use one of the following: %s',
            implode(', ', $this->modes)
        );
    }


}