<?php

namespace App\Validator\Constraints;

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

#[\Attribute]
class OrganizationalUnitP2PMode 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 = OrganizationalUnitP2PModes::getP2pModes();
        $this->message = sprintf(
            'The p2p mode is not valid. Please use one of the following: %s',
            implode(', ', $this->modes)
        );
    }


}