Moved custom validators from annotations to attributes

This commit is contained in:
Jan Böhmer 2023-06-11 19:32:15 +02:00
parent e5a14557a2
commit 930adaf439
27 changed files with 50 additions and 148 deletions

View file

@ -104,19 +104,13 @@ abstract class Attachment extends AbstractNamedDBElement
*/
protected ?AttachmentContainingDBElement $element = null;
/**
* @var bool
*/
#[ORM\Column(type: Types::BOOLEAN)]
protected bool $show_in_table = false;
/**
* @var AttachmentType|null
* @Selectable()
*/
#[Assert\NotNull(message: 'validator.attachment.must_not_be_null')]
#[ORM\ManyToOne(targetEntity: 'AttachmentType', inversedBy: 'attachments_with_type')]
#[ORM\JoinColumn(name: 'type_id', nullable: false)]
#[Selectable()]
protected ?AttachmentType $attachment_type = null;
public function __construct()

View file

@ -50,12 +50,10 @@ class AttachmentType extends AbstractStructuralDBElement
#[ORM\JoinColumn(name: 'parent_id')]
protected ?AbstractStructuralDBElement $parent = null;
/**
* @var string
* @ValidFileFilter
*/
#[ORM\Column(type: Types::TEXT)]
#[ValidFileFilter]
protected string $filetype_filter = '';
/**
* @var Collection<int, AttachmentTypeAttachment>
*/