start working on pair documents

This commit is contained in:
Hesabix 2024-12-12 10:21:52 +00:00
parent d038599ebf
commit 1cdd3e0bf0

View file

@ -107,6 +107,13 @@ class HesabdariDoc
#[ORM\ManyToOne(inversedBy: 'hesabdariDocs')]
private ?Person $salesman = null;
/**
* @var Collection<int, self>
*/
#[ORM\ManyToMany(targetEntity: self::class)]
#[ORM\JoinTable(name: 'pairDoc')]
private Collection $pairDoc;
public function __construct()
{
$this->hesabdariRows = new ArrayCollection();
@ -115,6 +122,7 @@ class HesabdariDoc
$this->storeroomTickets = new ArrayCollection();
$this->logs = new ArrayCollection();
$this->notes = new ArrayCollection();
$this->pairDoc = new ArrayCollection();
}
public function getId(): ?int
@ -535,4 +543,28 @@ class HesabdariDoc
return $this;
}
/**
* @return Collection<int, self>
*/
public function getPairDoc(): Collection
{
return $this->pairDoc;
}
public function addPairDoc(self $pairDoc): static
{
if (!$this->pairDoc->contains($pairDoc)) {
$this->pairDoc->add($pairDoc);
}
return $this;
}
public function removePairDoc(self $pairDoc): static
{
$this->pairDoc->removeElement($pairDoc);
return $this;
}
}