Refactored some stuff

This commit is contained in:
Kevin Frantz 2018-10-28 22:49:57 +01:00
parent cb0e3739b1
commit ca5552ffd6

View File

@ -5,13 +5,13 @@ namespace App\Controller;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use App\Entity\NodeInterface;
use App\Entity\Node;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use App\Entity\Meta\RelationInterface;
use App\Entity\Meta\Relation;
/** /**
* @todo IMPLEMENT SECURITY! * @todo IMPLEMENT SECURITY!
* * @todo Refactor!
* @author kevinfrantz * @author kevinfrantz
*/ */
class NodeController extends AbstractEntityController class NodeController extends AbstractEntityController
@ -22,10 +22,10 @@ class NodeController extends AbstractEntityController
public function show(Request $request, int $id): Response public function show(Request $request, int $id): Response
{ {
/** /**
* @var NodeInterface $node * @var RelationInterface $node
*/ */
$node = $this->loadEntityById($id); $relation = $this->loadEntityById($id);
$view = $this->view($node, 200) $view = $this->view($relation, 200)
->setTemplate('node/view/standard.html.twig') ->setTemplate('node/view/standard.html.twig')
->setTemplateVar('node'); ->setTemplateVar('node');
return $this->handleView($view); return $this->handleView($view);
@ -60,6 +60,6 @@ class NodeController extends AbstractEntityController
protected function setEntityName(): void protected function setEntityName(): void
{ {
$this->entityName = Node::class; $this->entityName = Relation::class;
} }
} }