mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
first commit: rendez-vous menu entry deleted from task usermenubuilder. Start sous-types
This commit is contained in:
parent
951d686366
commit
601c16ac27
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\AsideActivityBundle\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
@ -21,6 +20,16 @@ class AsideActivityCategory
|
||||
*/
|
||||
private int $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=AsideActivityCategory::class, inversedBy="children")
|
||||
*/
|
||||
private $parent;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=AsideActivityCategory::class, mappedBy="parent")
|
||||
*/
|
||||
private $children;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json", length=255)
|
||||
*/
|
||||
@ -59,4 +68,52 @@ class AsideActivityCategory
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getParent(): ?self
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
public function hasParent(): bool
|
||||
{
|
||||
return $this->parent !== null;
|
||||
}
|
||||
|
||||
public function setParent(?self $parent): self
|
||||
{
|
||||
$this->parent = $parent;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|self[]
|
||||
*/
|
||||
public function getChildren(): Collection
|
||||
{
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
public function addChild(self $child): self
|
||||
{
|
||||
if (!$this->children->contains($child)) {
|
||||
$this->children[] = $child;
|
||||
$child->setParent($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeChild(self $child): self
|
||||
{
|
||||
if ($this->children->removeElement($child)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($child->getParent() === $this) {
|
||||
$child->setParent(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
services:
|
||||
Chill\AsideActivityBundle\Menu\:
|
||||
resource: './../../Menu'
|
||||
resource: "./../../Menu"
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
@ -115,16 +115,16 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
'icon' => 'tasks'
|
||||
]);
|
||||
|
||||
$menu->addChild("My calendar list", [
|
||||
'route' => 'chill_calendar_calendar_list',
|
||||
'routeParameters' => [
|
||||
'user_id' => $user->getId(),
|
||||
]
|
||||
])
|
||||
->setExtras([
|
||||
'order' => -9,
|
||||
'icon' => 'tasks'
|
||||
]);
|
||||
// $menu->addChild("My calendar list", [
|
||||
// 'route' => 'chill_calendar_calendar_list',
|
||||
// 'routeParameters' => [
|
||||
// 'user_id' => $user->getId(),
|
||||
// ]
|
||||
// ])
|
||||
// ->setExtras([
|
||||
// 'order' => -9,
|
||||
// 'icon' => 'tasks'
|
||||
// ]);
|
||||
|
||||
/*
|
||||
$menu->addChild("My aside activities", [
|
||||
|
Loading…
x
Reference in New Issue
Block a user