mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Entity draft
This commit is contained in:
parent
9520b09db0
commit
2a1f3bd264
@ -1,18 +1,17 @@
|
||||
<?php
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Entity\attribut\IdAttribut;
|
||||
use App\Entity\attribut\NodeAttribut;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class AbstractSource implements SourceInterface
|
||||
abstract class AbstractSource implements SourceInterface
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var Node
|
||||
*/
|
||||
protected $node;
|
||||
use IdAttribut,NodeAttribut;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -20,22 +19,4 @@ class AbstractSource implements SourceInterface
|
||||
*/
|
||||
protected $configuration;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
public function setId(int $id): void
|
||||
{}
|
||||
|
||||
public function setNode(NodeInterface $node): void
|
||||
{}
|
||||
|
||||
public function getId(): int
|
||||
{}
|
||||
|
||||
public function getNode(): NodeInterface
|
||||
{}
|
||||
|
||||
}
|
@ -6,7 +6,7 @@ namespace App\Entity;
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class Configuration extends AbstractSource implements ConfigurationInterface
|
||||
class Configuration implements ConfigurationInterface
|
||||
{
|
||||
/**
|
||||
*
|
||||
@ -25,6 +25,7 @@ class Configuration extends AbstractSource implements ConfigurationInterface
|
||||
* @var PropertyInterface
|
||||
*/
|
||||
protected $administrate;
|
||||
|
||||
public function setAdministrate(Property $administrate): void
|
||||
{}
|
||||
|
||||
|
@ -2,13 +2,14 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Entity\attribut\SourceAttributInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface NodeInterface
|
||||
interface NodeInterface extends SourceAttributInterface
|
||||
{
|
||||
public function getId():int;
|
||||
|
||||
@ -19,9 +20,5 @@ interface NodeInterface
|
||||
public function setChilds(ArrayCollection $childs):void;
|
||||
|
||||
public function getChilds():ArrayCollection;
|
||||
|
||||
public function getSource():SourceInterface;
|
||||
|
||||
public function setSource(SourceInterface $source):void;
|
||||
}
|
||||
|
||||
|
@ -1,19 +1,15 @@
|
||||
<?php
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Entity\attribut\NodeAttributInterface;
|
||||
use App\Entity\attribut\IdAttributInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface SourceInterface
|
||||
interface SourceInterface extends IdAttributInterface, NodeAttributInterface
|
||||
{
|
||||
public function setId(int $id):void;
|
||||
|
||||
public function getId():int;
|
||||
|
||||
public function setNode(NodeInterface $node):void;
|
||||
|
||||
public function getNode():NodeInterface;
|
||||
}
|
||||
|
||||
|
@ -9,15 +9,8 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
* @ORM\Table(name="source_user")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
|
||||
*/
|
||||
class User implements UserInterface, \Serializable
|
||||
class User extends AbstractSource implements UserInterface, \Serializable
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=25, unique=true)
|
||||
*/
|
||||
|
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
namespace App\Entity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface UserInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
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;
|
||||
}
|
||||
|
28
application/src/Entity/attribut/NodeAttribut.php
Normal file
28
application/src/Entity/attribut/NodeAttribut.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace App\Entity\attribut;
|
||||
|
||||
use App\Entity\NodeInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
trait NodeAttribut{
|
||||
/**
|
||||
* @var NodeInterface
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user