Left hints and deprecated functions

This commit is contained in:
Kevin Frantz 2018-12-31 21:02:18 +01:00
parent e30145d792
commit 8c082bb0a4

View File

@ -7,22 +7,39 @@ use FOS\RestBundle\Controller\FOSRestController;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
* @todo Check which of the as deprecated declared functions make sense to remove
*
* @author kevinfrantz
*/
abstract class AbstractEntityController extends FOSRestController
{
/**
* @deprecated
*
* @var string
*/
protected $entityName;
/**
* @deprecated
*/
public function __construct()
{
$this->setEntityName();
}
/**
* @deprecated
*/
abstract protected function setEntityName(): void;
/**
* @deprecated
*
* @param int $id
*
* @return EntityInterface
*/
protected function loadEntityById(int $id): EntityInterface
{
$entity = $this->getDoctrine()
@ -35,6 +52,13 @@ abstract class AbstractEntityController extends FOSRestController
return $entity;
}
/**
* @deprecated
*
* @param string $slug
*
* @return EntityInterface
*/
protected function loadEntityBySlug(string $slug): EntityInterface
{
$entity = $this->getDoctrine()
@ -47,6 +71,14 @@ abstract class AbstractEntityController extends FOSRestController
return $entity;
}
/**
* @deprecated
*
* @param string $route
* @param int $id
*
* @return RedirectResponse
*/
protected function redirectToRouteById(string $route, int $id): RedirectResponse
{
return $this->redirectToRoute($route, [