svg
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\IssueRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: IssueRepository::class)]
|
||||
@ -32,6 +34,25 @@ class Issue
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private Project $project;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Issue::class, inversedBy: 'childs')]
|
||||
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
|
||||
private ?Issue $parent = null;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Issue::class, mappedBy: 'parent', cascade: ['persist'])]
|
||||
#[ORM\OrderBy([
|
||||
'rowstatus' => 'ASC',
|
||||
'rowsprint' => 'DESC',
|
||||
'rowversion' => 'DESC',
|
||||
'rowissue' => 'ASC',
|
||||
'id' => 'DESC',
|
||||
])]
|
||||
private Collection $childs;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->childs = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@ -115,4 +136,24 @@ class Issue
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getParent(): ?Issue
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
public function setParent(?Issue $issue): self
|
||||
{
|
||||
$this->parent = $issue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Issue>
|
||||
*/
|
||||
public function getChilds(): Collection
|
||||
{
|
||||
return $this->childs;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user