Added GTIN fields and others to DB

This commit is contained in:
Jan Böhmer 2026-02-08 14:17:58 +01:00
parent c2a51e57b7
commit 7fd7697c02
7 changed files with 225 additions and 1 deletions

View file

@ -84,6 +84,14 @@ trait AdvancedPropertyTrait
#[ORM\JoinColumn(name: 'id_part_custom_state')]
protected ?PartCustomState $partCustomState = null;
/**
* @var string|null The GTIN (Global Trade Item Number) of the part, for example a UPC or EAN code
*/
#[Groups(['extended', 'full', 'import', 'part:read', 'part:write'])]
#[ORM\Column(type: Types::STRING, nullable: true)]
#[Length(max: 14)]
protected ?string $gtin = null;
/**
* Checks if this part is marked, for that it needs further review.
*/
@ -211,4 +219,26 @@ trait AdvancedPropertyTrait
return $this;
}
/**
* Gets the GTIN (Global Trade Item Number) of the part, for example a UPC or EAN code.
* Returns null if no GTIN is set.
*/
public function getGtin(): ?string
{
return $this->gtin;
}
/**
* Sets the GTIN (Global Trade Item Number) of the part, for example a UPC or EAN code.
*
* @param string|null $gtin The new GTIN of the part
*
* @return $this
*/
public function setGtin(?string $gtin): self
{
$this->gtin = $gtin;
return $this;
}
}