mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 06:01:35 +01:00
Controller and Entity draft
This commit is contained in:
parent
3a4f3f6654
commit
8ead5a5df4
17
application/src/Controller/ActivationInterface.php
Normal file
17
application/src/Controller/ActivationInterface.php
Normal 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;
|
||||
}
|
||||
|
17
application/src/Controller/CreationInterface.php
Normal file
17
application/src/Controller/CreationInterface.php
Normal 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;
|
||||
}
|
||||
|
13
application/src/Controller/ModificationInterface.php
Normal file
13
application/src/Controller/ModificationInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface ModificationInterface
|
||||
{
|
||||
public function modify(int $id):Response;
|
||||
}
|
||||
|
12
application/src/Controller/SourceController.php
Normal file
12
application/src/Controller/SourceController.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class SourceController implements NodeControllerInterface
|
||||
{
|
||||
}
|
||||
|
15
application/src/Controller/SourceControllerInterface.php
Normal file
15
application/src/Controller/SourceControllerInterface.php
Normal 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;
|
||||
}
|
||||
|
12
application/src/Controller/UserController.php
Normal file
12
application/src/Controller/UserController.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class UserController implements UserControllerInterface
|
||||
{
|
||||
}
|
||||
|
18
application/src/Controller/UserControllerInterface.php
Normal file
18
application/src/Controller/UserControllerInterface.php
Normal 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;
|
||||
}
|
41
application/src/Entity/AbstractSource.php
Normal file
41
application/src/Entity/AbstractSource.php
Normal 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
|
||||
{}
|
||||
|
||||
}
|
29
application/src/Entity/Configuration.php
Normal file
29
application/src/Entity/Configuration.php
Normal 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;
|
||||
}
|
||||
|
24
application/src/Entity/ConfigurationInterface.php
Normal file
24
application/src/Entity/ConfigurationInterface.php
Normal 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;
|
||||
|
||||
}
|
||||
|
59
application/src/Entity/Node.php
Normal file
59
application/src/Entity/Node.php
Normal 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
|
||||
{}
|
||||
|
||||
}
|
||||
|
27
application/src/Entity/NodeInterface.php
Normal file
27
application/src/Entity/NodeInterface.php
Normal 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;
|
||||
}
|
||||
|
32
application/src/Entity/Property.php
Normal file
32
application/src/Entity/Property.php
Normal 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
|
||||
{}
|
||||
|
||||
}
|
||||
|
17
application/src/Entity/PropertyInterface.php
Normal file
17
application/src/Entity/PropertyInterface.php
Normal 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;
|
||||
}
|
||||
|
19
application/src/Entity/SourceInterface.php
Normal file
19
application/src/Entity/SourceInterface.php
Normal 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;
|
||||
}
|
||||
|
12
application/src/Entity/User.php
Normal file
12
application/src/Entity/User.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace App\Entity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class User extends AbstractSource implements UserInterface
|
||||
{
|
||||
}
|
||||
|
13
application/src/Entity/UserInterface.php
Normal file
13
application/src/Entity/UserInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace App\Entity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface UserInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user