Controller and Entity draft

This commit is contained in:
Kevin Frantz 2018-09-05 15:46:14 +02:00
parent 3a4f3f6654
commit 8ead5a5df4
17 changed files with 377 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
*
* @author kevinfrantz
*
*/
interface ActivationInterface
{
public function deactivate():Response;
public function activate():Response;
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
*
* @author kevinfrantz
*
*/
interface CreationInterface
{
public function create():Response;
public function delete():Response;
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Controller;
/**
*
* @author kevinfrantz
*
*/
interface ModificationInterface
{
public function modify(int $id):Response;
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Controller;
/**
*
* @author kevinfrantz
*
*/
class SourceController implements NodeControllerInterface
{
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
*
* @author kevinfrantz
*
*/
interface SourceControllerInterface extends CreationInterface, ActivationInterface, ModificationInterface
{
public function show(int $id):Response;
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Controller;
/**
*
* @author kevinfrantz
*
*/
class UserController implements UserControllerInterface
{
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
*
* @author kevinfrantz
*
*/
interface UserControllerInterface extends CreationInterface, ActivationInterface,ModificationInterface
{
public function logout():Response;
public function login():Response;
public function register():Response;
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Entity;
/**
*
* @author kevinfrantz
*
*/
class AbstractSource implements SourceInterface
{
/**
*
* @var Node
*/
protected $node;
/**
*
* @var ConfigurationInterface
*/
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
{}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\Entity;
/**
*
* @author kevinfrantz
*
*/
class Configuration extends AbstractSource implements ConfigurationInterface
{
/**
*
* @var PropertyInterface
*/
protected $read;
/**
*
* @var PropertyInterface
*/
protected $write;
/**
*
* @var PropertyInterface
*/
protected $administrate;
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Entity;
/**
*
* @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

@ -0,0 +1,59 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
* @author kevinfrantz
*
*/
class Node implements NodeInterface
{
/**
*
* @var int
*/
protected $id;
/**
*
* @var SourceInterface
*/
protected $source;
/**
*
* @var ArrayCollection|Node[]
*/
protected $parents;
/**
*
* @var ArrayCollection|Node[]
*/
protected $childs;
public function getParents(): ArrayCollection
{}
public function setParents(ArrayCollection $parents): void
{}
public function getChilds(): ArrayCollection
{}
public function setChilds(ArrayCollection $childs): void
{}
public function getId(): int
{}
public function setSource(SourceInterface $source)
{}
public function getSource(): SourceInterface
{}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
* @author kevinfrantz
*
*/
interface NodeInterface
{
public function getId():int;
public function setParents(ArrayCollection $parents):void;
public function getParents():ArrayCollection;
public function setChilds(ArrayCollection $childs):void;
public function getChilds():ArrayCollection;
public function getSource():SourceInterface;
public function setSource(SourceInterface $source):void;
}

View File

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

View File

@ -0,0 +1,17 @@
<?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

@ -0,0 +1,19 @@
<?php
namespace App\Entity;
/**
*
* @author kevinfrantz
*
*/
interface SourceInterface
{
public function setId(int $id):void;
public function getId():int;
public function setNode(NodeInterface $node):void;
public function getNode():NodeInterface;
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entity;
/**
*
* @author kevinfrantz
*
*/
class User extends AbstractSource implements UserInterface
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Entity;
/**
*
* @author kevinfrantz
*
*/
interface UserInterface
{
}