Optimized Law draft

This commit is contained in:
Kevin Frantz
2018-09-13 22:35:32 +02:00
parent 69f2beac72
commit ff7fb57baf
13 changed files with 160 additions and 30 deletions

View File

@@ -1,9 +1,6 @@
<?php
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\NodeInterface;
namespace Entity\Attribut;
/**
* @author kevinfrantz
@@ -11,25 +8,17 @@ use App\Entity\NodeInterface;
trait ParentAttribut
{
/**
* 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 ArrayCollection|NodeInterface[]
* @var ParentAttributInterface
*/
protected $parents;
protected $parent;
public function getParents(): ArrayCollection
public function setParent(ParentAttributInterface $parent): void
{
return $this->parents;
$this->parent = $parent;
}
public function setParents(ArrayCollection $parents): void
public function getParent(): ParentAttributInterface
{
$this->parents = $parents;
return $this->parent;
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace Entity\Attribut;
/**
* @author kevinfrantz
*/
interface ParentAttributInterface
{
public function setParent(ParentAttributInterface $parent): void;
public function getParent(): ParentAttributInterface;
}

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\NodeInterface;
/**
* @author kevinfrantz
*/
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 ArrayCollection|NodeInterface[]
*/
protected $parents;
public function getParents(): ArrayCollection
{
return $this->parents;
}
public function setParents(ArrayCollection $parents): void
{
$this->parents = $parents;
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @author kevinfrantz
*/
trait PermissionAttribut
{
/**
* @var ArrayCollection
*/
protected $permissions;
public function setPermissions(ArrayCollection $permissions): void
{
$this->permissions = $permissions;
}
public function getPermissions(): ArrayCollection
{
return $this->permissions;
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @author kevinfrantz
*/
interface PermissionsAttributInterface
{
public function setPermissions(ArrayCollection $permissions): void;
public function getPermissions(): ArrayCollection;
}

View File

@@ -0,0 +1,26 @@
<?php
namespace Entity\Attribut;
use App\Entity\RightInterface;
/**
* @author kevinfrantz
*/
trait RightAttribut
{
/**
* @var RightInterface
*/
protected $right;
public function setRight(RightInterface $right): void
{
$this->right = $right;
}
public function getRight(): RightInterface
{
return $this->getRight();
}
}