Allow to import category, footprint and manufacturer by giving a string in the CSV file

This commit is contained in:
Jan Böhmer 2023-03-12 21:10:48 +01:00
parent 85ae862381
commit 61e2dde400
12 changed files with 173 additions and 35 deletions

View file

@ -92,7 +92,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
/**
* @var AbstractStructuralDBElement
* @NoneOfItsChildren()
* @Groups({"include_parents"})
* @Groups({"include_parents", "import"})
*/
protected $parent = null;

View file

@ -65,7 +65,7 @@ trait BasicPropertyTrait
* @ORM\JoinColumn(name="id_category", referencedColumnName="id", nullable=false)
* @Selectable()
* @Assert\NotNull(message="validator.select_valid_category")
* @Groups({"simple", "extended", "full"})
* @Groups({"simple", "extended", "full", "import"})
*/
protected ?Category $category = null;
@ -74,7 +74,7 @@ trait BasicPropertyTrait
* @ORM\ManyToOne(targetEntity="Footprint")
* @ORM\JoinColumn(name="id_footprint", referencedColumnName="id")
* @Selectable()
* @Groups({"simple", "extended", "full"})
* @Groups({"simple", "extended", "full", "import"})
*/
protected ?Footprint $footprint = null;

View file

@ -56,7 +56,7 @@ trait InstockTrait
* @var ?MeasurementUnit the unit in which the part's amount is measured
* @ORM\ManyToOne(targetEntity="MeasurementUnit")
* @ORM\JoinColumn(name="id_part_unit", referencedColumnName="id", nullable=true)
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected ?MeasurementUnit $partUnit = null;

View file

@ -39,7 +39,7 @@ trait ManufacturerTrait
* @ORM\ManyToOne(targetEntity="Manufacturer")
* @ORM\JoinColumn(name="id_manufacturer", referencedColumnName="id")
* @Selectable()
* @Groups({"simple","extended", "full"})
* @Groups({"simple","extended", "full", "import"})
*/
protected ?Manufacturer $manufacturer = null;