<?php

namespace App\Validator\Constraints;

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

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

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

        $this->types = OrganizationalUnitTypes::getOrganizationalUnitTypeKeys();
        $this->message = sprintf(
            'The organizational unit type is not valid. Please use one of the following: %s',
            implode(', ', $this->types)
        );
    }


}