mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-14 06:07:18 +02:00
Optimized Entity draft
This commit is contained in:
27
application/src/Entity/Attribut/IdAttribut.php
Normal file
27
application/src/Entity/Attribut/IdAttribut.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
trait IdAttribut {
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
||||
|
15
application/src/Entity/Attribut/IdAttributInterface.php
Normal file
15
application/src/Entity/Attribut/IdAttributInterface.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface IdAttributInterface
|
||||
{
|
||||
public function setId(int $id): void;
|
||||
|
||||
public function getId(): int;
|
||||
}
|
||||
|
30
application/src/Entity/Attribut/NodeAttribut.php
Normal file
30
application/src/Entity/Attribut/NodeAttribut.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\NodeInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
trait NodeAttribut{
|
||||
/**
|
||||
* @var NodeInterface
|
||||
* @OneToOne(targetEntity="Node")
|
||||
* @JoinColumn(name="source", referencedColumnName="id")
|
||||
*/
|
||||
protected $node;
|
||||
|
||||
public function setNode(NodeInterface $node): void
|
||||
{
|
||||
$this->node = $node;
|
||||
}
|
||||
|
||||
public function getNode(): NodeInterface
|
||||
{
|
||||
return $this->node;
|
||||
}
|
||||
|
||||
}
|
||||
|
17
application/src/Entity/Attribut/NodeAttributInterface.php
Normal file
17
application/src/Entity/Attribut/NodeAttributInterface.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\NodeInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface NodeAttributInterface
|
||||
{
|
||||
public function setNode(NodeInterface $node):void;
|
||||
|
||||
public function getNode():NodeInterface;
|
||||
}
|
||||
|
29
application/src/Entity/Attribut/ParentAttribut.php
Normal file
29
application/src/Entity/Attribut/ParentAttribut.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\NodeInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
trait ParentAttribut {
|
||||
/**
|
||||
*
|
||||
* @var ArrayCollection|NodeInterface[]
|
||||
*/
|
||||
protected $parents;
|
||||
|
||||
public function getParents(): ArrayCollection
|
||||
{
|
||||
return $this->parents;
|
||||
}
|
||||
|
||||
public function setParents(ArrayCollection $parents): void
|
||||
{
|
||||
$this->parents = $parents;
|
||||
}
|
||||
}
|
||||
|
17
application/src/Entity/Attribut/ParentsAttributInterface.php
Normal file
17
application/src/Entity/Attribut/ParentsAttributInterface.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface ParentsAttributInterface
|
||||
{
|
||||
public function setParents(ArrayCollection $parents):void;
|
||||
|
||||
public function getParents():ArrayCollection;
|
||||
}
|
||||
|
25
application/src/Entity/Attribut/SourceAttribut.php
Normal file
25
application/src/Entity/Attribut/SourceAttribut.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\SourceInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
trait SourceAttribut {
|
||||
/**
|
||||
* @var SourceInterface
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
public function getSource():SourceInterface{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
public function setSource(SourceInterface $source):void{
|
||||
$this->source = $source;
|
||||
}
|
||||
}
|
||||
|
17
application/src/Entity/Attribut/SourceAttributInterface.php
Normal file
17
application/src/Entity/Attribut/SourceAttributInterface.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\SourceInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface SourceAttributInterface
|
||||
{
|
||||
public function getSource():SourceInterface;
|
||||
|
||||
public function setSource(SourceInterface $source):void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user