mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Added possibility to generate labels for storelocations.
This commit is contained in:
parent
9a9cd8e887
commit
bd6a0de0a2
12 changed files with 126 additions and 4 deletions
|
@ -37,11 +37,28 @@ class BarcodeExampleElementsGenerator
|
|||
return $this->getExamplePart();
|
||||
case 'part_lot':
|
||||
return $this->getExamplePartLot();
|
||||
case 'storelocation':
|
||||
return $this->getStorelocation();
|
||||
default:
|
||||
throw new \InvalidArgumentException('Unknown $type.');
|
||||
}
|
||||
}
|
||||
|
||||
protected function getStorelocation(): Storelocation
|
||||
{
|
||||
$storelocation = new Storelocation();
|
||||
$storelocation->setName('Location 1');
|
||||
$storelocation->setComment('Example comment');
|
||||
$storelocation->updatedTimestamps();
|
||||
|
||||
$parent = new Storelocation();
|
||||
$parent->setName('Parent');
|
||||
|
||||
$storelocation->setParent($parent);
|
||||
|
||||
return $storelocation;
|
||||
}
|
||||
|
||||
protected function getStructuralData(string $class): AbstractStructuralDBElement
|
||||
{
|
||||
if (!is_a($class, AbstractStructuralDBElement::class, true)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue