mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Left hints and deprecated functions
This commit is contained in:
parent
e30145d792
commit
8c082bb0a4
@ -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, [
|
||||
|
Loading…
Reference in New Issue
Block a user