tarlepp/symfony-flex-backend

View on GitHub
src/DTO/UserGroup/UserGroupCreate.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php
declare(strict_types = 1);
/**
 * /src/Rest/DTO/UserGroup/UserGroupCreate.php
 *
 * @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
 */

namespace App\DTO\UserGroup;

use App\Entity\Role;
use App\Validator\Constraints as AppAssert;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @package App\DTO\UserGroup
 * @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
 */
class UserGroupCreate extends UserGroup
{
    #[Assert\NotBlank]
    #[Assert\NotNull]
    #[AppAssert\EntityReferenceExists(entityClass: Role::class)]
    protected ?Role $role = null;
}