Optimized entities

This commit is contained in:
Kevin Frantz 2018-09-13 12:29:07 +02:00
parent dee5ee8974
commit d1b7e0f070
7 changed files with 5 additions and 120 deletions

View File

@ -19,8 +19,7 @@ abstract class AbstractSource implements SourceInterface
{
use IdAttribut,NodeAttribut;
/**
* @var ConfigurationInterface
*/
protected $configuration;
public function __construct(){
$this->node = new Node();
}
}

View File

@ -11,7 +11,7 @@ trait NodeAttribut
{
/**
* @var NodeInterface
* @ORM\OneToOne(targetEntity="Node")
* @ORM\OneToOne(targetEntity="Node",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="node_id", referencedColumnName="id")
*/
protected $node;

View File

@ -1,48 +0,0 @@
<?php
namespace App\Entity;
/**
* @author kevinfrantz
*/
class Configuration implements ConfigurationInterface
{
/**
* @var PropertyInterface
*/
protected $read;
/**
* @var PropertyInterface
*/
protected $write;
/**
* @var PropertyInterface
*/
protected $administrate;
public function setAdministrate(Property $administrate): void
{
}
public function getAdministrate(): Property
{
}
public function setWrite(Property $write): void
{
}
public function getWrite(): Property
{
}
public function setRead(Property $read): void
{
}
public function getRead(): Property
{
}
}

View File

@ -1,23 +0,0 @@
<?php
namespace App\Entity;
/**
* This class is not a source!
*
* @author kevinfrantz
*/
interface ConfigurationInterface
{
public function setRead(Property $read): void;
public function getRead(): Property;
public function setWrite(Property $write): void;
public function getWrite(): Property;
public function setAdministrate(Property $administrate): void;
public function getAdministrate(): Property;
}

View File

@ -1,29 +0,0 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @author kevinfrantz
*/
class Property implements PropertyInterface
{
/**
* @var ArrayCollection|NodeInterface[]
*/
protected $whitelist;
/**
* @var ArrayCollection|NodeInterface[]
*/
protected $blacklist;
public function getLegitimated(): ArrayCollection
{
}
public function isLegitimated(SourceInterface $source): bool
{
}
}

View File

@ -1,15 +0,0 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @author kevinfrantz
*/
interface PropertyInterface
{
public function isLegitimated(SourceInterface $source): bool;
public function getLegitimated(): ArrayCollection;
}

View File

@ -45,5 +45,6 @@ class User extends BaseUser implements SourceInterface
* @var \App\Entity\User $isActive
*/
$this->isActive = true;
$this->node = new Node();
}
}