mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Added draft for LawController
This commit is contained in:
parent
ab15856aa4
commit
94bc8c5da4
36
application/src/Controller/LawController.php
Normal file
36
application/src/Controller/LawController.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class LawController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/law/{id}.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function show():Response{
|
||||
//Implement
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/law/{id}/right.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function right(int $id):RedirectResponse{
|
||||
//Implement
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/law/{id}/node.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function node(int $id):RedirectResponse{
|
||||
//Implement
|
||||
}
|
||||
}
|
@ -37,7 +37,6 @@ class NodeController extends FOSRestController
|
||||
if (!$node) {
|
||||
throw $this->createNotFoundException('No node found for id '.$id);
|
||||
}
|
||||
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
|
@ -11,14 +11,6 @@ use Doctrine\Common\Collections\Collection;
|
||||
trait ChildsAttribut
|
||||
{
|
||||
/**
|
||||
* Many Nodes have many childs.
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity="Node")
|
||||
* @ORM\JoinTable(name="nodes_childs",
|
||||
* joinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")}
|
||||
* )
|
||||
*
|
||||
* @var Collection|NodeInterface[]
|
||||
*/
|
||||
protected $childs;
|
||||
|
@ -11,14 +11,6 @@ use Doctrine\Common\Collections\Collection;
|
||||
trait ParentsAttribut
|
||||
{
|
||||
/**
|
||||
* Many Nodes have many parents.
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity="Node")
|
||||
* @ORM\JoinTable(name="nodes_parents",
|
||||
* joinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")}
|
||||
* )
|
||||
*
|
||||
* @var Collection|NodeInterface[]
|
||||
*/
|
||||
protected $parents;
|
||||
|
@ -6,8 +6,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Attribut\RightsAttribute;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\Attribut\NodeAttribut;
|
||||
use App\Entity\LawInterface;
|
||||
use App\Entity\NodeInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@ -45,8 +43,7 @@ class Law extends AbstractEntity implements LawInterface
|
||||
|
||||
public function isGranted(NodeInterface $node, string $layer, string $right): bool
|
||||
{
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* @var RightInterface
|
||||
*/
|
||||
foreach ($this->rights->toArray() as $right) {
|
||||
|
@ -9,9 +9,8 @@ use App\Entity\Attribut\ParentsAttribut;
|
||||
use App\Entity\Attribut\ChildsAttribut;
|
||||
use App\Entity\Attribut\LawAttribut;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\NodeInterface;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use App\Entity\LawInterface;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@ -26,6 +25,31 @@ class Node extends AbstractEntity implements NodeInterface
|
||||
LawAttribut,
|
||||
ChildsAttribut;
|
||||
|
||||
/**
|
||||
* Many Nodes have many parents.
|
||||
* @ORM\ManyToMany(targetEntity="Node")
|
||||
* @ORM\JoinTable(name="nodes_parents",
|
||||
* joinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")}
|
||||
* )
|
||||
*
|
||||
* @var Collection|NodeInterface[]
|
||||
*/
|
||||
protected $parents;
|
||||
|
||||
/**
|
||||
* Many Nodes have many childs.
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity="Node")
|
||||
* @ORM\JoinTable(name="nodes_childs",
|
||||
* joinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")}
|
||||
* )
|
||||
*
|
||||
* @var Collection|NodeInterface[]
|
||||
*/
|
||||
protected $childs;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\AbstractSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="source_id", referencedColumnName="id")
|
||||
|
@ -9,8 +9,6 @@ use App\DBAL\Types\RecieverType;
|
||||
use Symfony\Component\Intl\Exception\NotImplementedException;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert;
|
||||
use App\Entity\RecieverGroupInterface;
|
||||
use App\Entity\NodeInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
|
Loading…
Reference in New Issue
Block a user