mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-04 15:34:35 +02:00
Moved custom validators from annotations to attributes
This commit is contained in:
parent
e5a14557a2
commit
930adaf439
27 changed files with 50 additions and 148 deletions
|
@ -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()
|
||||
|
|
|
@ -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>
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue