From afa8d7cb728fac408397895d96c050be07995e38 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 17 Nov 2021 11:46:15 +0100 Subject: [PATCH] fix: Creation of entity in createEntity(). Issue introduced in 5432242376f17b894247b97d3ec39cf5ec1e8bf4. --- .../CRUD/Controller/AbstractCRUDController.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php index 451ce8aab..ae19fb433 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php @@ -44,14 +44,9 @@ abstract class AbstractCRUDController extends AbstractController return $e; } - /** - * Create an entity. - * - * @return object - */ protected function createEntity(string $action, Request $request): object { - return $this->getEntityClass(); + return new ($this->getEntityClass()); } /** @@ -159,11 +154,10 @@ abstract class AbstractCRUDController extends AbstractController return null; } - /** * Get the FQDN of the class. * - * @return string The FQDN of the class + * @return class-string The FQDN of the class */ protected function getEntityClass(): string {