mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-26 21:09:31 +00: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
|
|
@ -62,9 +62,9 @@ trait BasicPropertyTrait
|
|||
/**
|
||||
* @var Category|null The category this part belongs too (e.g. Resistors). Use tags, for more complex grouping.
|
||||
* Every part must have a category.
|
||||
* @Selectable()
|
||||
*/
|
||||
#[Assert\NotNull(message: 'validator.select_valid_category')]
|
||||
#[Selectable()]
|
||||
#[Groups(['simple', 'extended', 'full', 'import'])]
|
||||
#[ORM\ManyToOne(targetEntity: 'Category')]
|
||||
#[ORM\JoinColumn(name: 'id_category', nullable: false)]
|
||||
|
|
@ -72,11 +72,11 @@ trait BasicPropertyTrait
|
|||
|
||||
/**
|
||||
* @var Footprint|null The footprint of this part (e.g. DIP8)
|
||||
* @Selectable()
|
||||
*/
|
||||
#[Groups(['simple', 'extended', 'full', 'import'])]
|
||||
#[ORM\ManyToOne(targetEntity: 'Footprint')]
|
||||
#[ORM\JoinColumn(name: 'id_footprint')]
|
||||
#[Selectable()]
|
||||
protected ?Footprint $footprint = null;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ trait ManufacturerTrait
|
|||
{
|
||||
/**
|
||||
* @var Manufacturer|null The manufacturer of this part
|
||||
* @Selectable()
|
||||
*/
|
||||
#[Groups(['simple', 'extended', 'full', 'import'])]
|
||||
#[ORM\ManyToOne(targetEntity: 'Manufacturer')]
|
||||
#[ORM\JoinColumn(name: 'id_manufacturer')]
|
||||
#[Selectable()]
|
||||
protected ?Manufacturer $manufacturer = null;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue