mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 05:39:33 +00:00
Baugruppen Stückliste um referenzierte Baugruppe erweitern
This commit is contained in:
parent
bdbaab98c5
commit
2cbda93e84
48 changed files with 1202 additions and 149 deletions
|
|
@ -133,6 +133,18 @@ class AssemblyBOMEntry extends AbstractDBElement implements UniqueValidatableInt
|
|||
#[Groups(['bom_entry:read', 'bom_entry:write', 'full'])]
|
||||
protected ?Part $part = null;
|
||||
|
||||
/**
|
||||
* @var Assembly|null The associated assembly
|
||||
*/
|
||||
#[Assert\Expression(
|
||||
'(this.getPart() === null or this.getReferencedAssembly() === null) and (this.getName() === null or (this.getName() != null and this.getName() != ""))',
|
||||
message: 'validator.assembly.bom_entry.only_part_or_assembly_allowed'
|
||||
)]
|
||||
#[ORM\ManyToOne(targetEntity: Assembly::class)]
|
||||
#[ORM\JoinColumn(name: 'id_referenced_assembly', nullable: true, onDelete: 'SET NULL')]
|
||||
#[Groups(['bom_entry:read', 'bom_entry:write', ])]
|
||||
protected ?Assembly $referencedAssembly = null;
|
||||
|
||||
/**
|
||||
* @var Project|null The associated project
|
||||
*/
|
||||
|
|
@ -237,6 +249,17 @@ class AssemblyBOMEntry extends AbstractDBElement implements UniqueValidatableInt
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getReferencedAssembly(): ?Assembly
|
||||
{
|
||||
return $this->referencedAssembly;
|
||||
}
|
||||
|
||||
public function setReferencedAssembly(?Assembly $referencedAssembly): AssemblyBOMEntry
|
||||
{
|
||||
$this->referencedAssembly = $referencedAssembly;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getProject(): ?Project
|
||||
{
|
||||
return $this->project;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue