Use ReloadableEntityManager across API controllers.
This commit is contained in:
parent
f1bd2f61f8
commit
91a744b244
|
@ -4,13 +4,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity\Interfaces\IdentifiableEntityInterface;
|
||||
use App\Exception\ValidationException;
|
||||
use App\Http\Response;
|
||||
use App\Http\ServerRequest;
|
||||
use App\Paginator;
|
||||
use App\Utilities;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
@ -30,7 +30,7 @@ abstract class AbstractApiCrudController
|
|||
protected string $resourceRouteName;
|
||||
|
||||
public function __construct(
|
||||
protected EntityManagerInterface $em,
|
||||
protected ReloadableEntityManagerInterface $em,
|
||||
protected Serializer $serializer,
|
||||
protected ValidatorInterface $validator
|
||||
) {
|
||||
|
@ -104,8 +104,8 @@ abstract class AbstractApiCrudController
|
|||
array_merge(
|
||||
$context,
|
||||
[
|
||||
ObjectNormalizer::ENABLE_MAX_DEPTH => true,
|
||||
ObjectNormalizer::MAX_DEPTH_HANDLER => function (
|
||||
ObjectNormalizer::ENABLE_MAX_DEPTH => true,
|
||||
ObjectNormalizer::MAX_DEPTH_HANDLER => function (
|
||||
$innerObject,
|
||||
$outerObject,
|
||||
string $attributeName,
|
||||
|
|
|
@ -5,8 +5,8 @@ declare(strict_types=1);
|
|||
namespace App\Controller\Api\Admin;
|
||||
|
||||
use App\Acl;
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
|
@ -22,7 +22,7 @@ class RolesController extends AbstractAdminApiCrudController
|
|||
|
||||
public function __construct(
|
||||
protected Acl $acl,
|
||||
EntityManagerInterface $em,
|
||||
ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator
|
||||
) {
|
||||
|
|
|
@ -5,11 +5,11 @@ declare(strict_types=1);
|
|||
namespace App\Controller\Api\Admin;
|
||||
|
||||
use App\Controller\Api\AbstractApiCrudController;
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity;
|
||||
use App\Exception\ValidationException;
|
||||
use App\Http\Response;
|
||||
use App\Http\ServerRequest;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
|
@ -25,7 +25,7 @@ class SettingsController extends AbstractApiCrudController
|
|||
|
||||
public function __construct(
|
||||
protected Entity\Repository\SettingsRepository $settingsRepo,
|
||||
EntityManagerInterface $em,
|
||||
ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator
|
||||
) {
|
||||
|
|
|
@ -4,10 +4,10 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Controller\Api\Admin;
|
||||
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity;
|
||||
use App\Http\Response;
|
||||
use App\Http\ServerRequest;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use InvalidArgumentException;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
@ -25,7 +25,7 @@ class StorageLocationsController extends AbstractAdminApiCrudController
|
|||
|
||||
public function __construct(
|
||||
protected Entity\Repository\StorageLocationRepository $storageLocationRepo,
|
||||
EntityManagerInterface $em,
|
||||
ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator
|
||||
) {
|
||||
|
|
|
@ -5,13 +5,13 @@ declare(strict_types=1);
|
|||
namespace App\Controller\Api\Stations;
|
||||
|
||||
use App\Controller\Api\Traits\HasScheduleDisplay;
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity;
|
||||
use App\Exception\ValidationException;
|
||||
use App\Http\Response;
|
||||
use App\Http\ServerRequest;
|
||||
use App\Radio\AutoDJ\Scheduler;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
|
@ -28,7 +28,7 @@ abstract class AbstractScheduledEntityController extends AbstractStationApiCrudC
|
|||
public function __construct(
|
||||
protected Entity\Repository\StationScheduleRepository $scheduleRepo,
|
||||
protected Scheduler $scheduler,
|
||||
EntityManagerInterface $em,
|
||||
ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator,
|
||||
) {
|
||||
|
|
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Controller\Api\Stations;
|
||||
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity;
|
||||
use App\Exception\ValidationException;
|
||||
use App\Flysystem\StationFilesystems;
|
||||
|
@ -12,7 +13,6 @@ use App\Http\ServerRequest;
|
|||
use App\Message\WritePlaylistFileMessage;
|
||||
use App\Radio\Adapters;
|
||||
use App\Radio\Backend\Liquidsoap;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use InvalidArgumentException;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
@ -35,7 +35,7 @@ class FilesController extends AbstractStationApiCrudController
|
|||
protected Entity\Repository\CustomFieldRepository $customFieldsRepo,
|
||||
protected Entity\Repository\StationMediaRepository $mediaRepo,
|
||||
protected Entity\Repository\StationPlaylistMediaRepository $playlistMediaRepo,
|
||||
EntityManagerInterface $em,
|
||||
ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator
|
||||
) {
|
||||
|
@ -266,7 +266,7 @@ class FilesController extends AbstractStationApiCrudController
|
|||
$playlist = $this->em->getRepository(Entity\StationPlaylist::class)->findOneBy(
|
||||
[
|
||||
'station' => $station,
|
||||
'id' => $playlist_id,
|
||||
'id' => $playlist_id,
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -322,7 +322,7 @@ class FilesController extends AbstractStationApiCrudController
|
|||
$record = $repo->findOneBy(
|
||||
[
|
||||
'storage_location' => $mediaStorage,
|
||||
$field => $id,
|
||||
$field => $id,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -4,13 +4,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Controller\Api\Stations;
|
||||
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity;
|
||||
use App\Exception\StationUnsupportedException;
|
||||
use App\Http\Response;
|
||||
use App\Http\Router;
|
||||
use App\Http\ServerRequest;
|
||||
use App\Service\Flow\UploadedFile;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
|
@ -25,7 +25,7 @@ class MountsController extends AbstractStationApiCrudController
|
|||
protected string $resourceRouteName = 'api:stations:mount';
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator,
|
||||
protected Entity\Repository\StationMountRepository $mountRepo
|
||||
|
|
|
@ -6,12 +6,12 @@ namespace App\Controller\Api\Stations;
|
|||
|
||||
use App\Acl;
|
||||
use App\Controller\Api\AbstractApiCrudController;
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity;
|
||||
use App\Flysystem\StationFilesystems;
|
||||
use App\Http\Response;
|
||||
use App\Http\ServerRequest;
|
||||
use App\Service\Flow\UploadedFile;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
|
@ -26,7 +26,7 @@ class PodcastEpisodesController extends AbstractApiCrudController
|
|||
protected string $resourceRouteName = 'api:stations:podcast:episode';
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator,
|
||||
protected Entity\Repository\StationRepository $stationRepository,
|
||||
|
|
|
@ -6,12 +6,12 @@ namespace App\Controller\Api\Stations;
|
|||
|
||||
use App\Acl;
|
||||
use App\Controller\Api\AbstractApiCrudController;
|
||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||
use App\Entity;
|
||||
use App\Flysystem\StationFilesystems;
|
||||
use App\Http\Response;
|
||||
use App\Http\ServerRequest;
|
||||
use App\Service\Flow\UploadedFile;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use InvalidArgumentException;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
@ -28,7 +28,7 @@ class PodcastsController extends AbstractApiCrudController
|
|||
protected string $resourceRouteName = 'api:stations:podcast';
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator,
|
||||
protected Entity\Repository\StationRepository $stationRepository,
|
||||
|
|
|
@ -8,7 +8,6 @@ use App;
|
|||
use App\Entity;
|
||||
use App\Http\Response;
|
||||
use App\Http\ServerRequest;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use InvalidArgumentException;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
@ -26,7 +25,7 @@ class QueueController extends AbstractStationApiCrudController
|
|||
public function __construct(
|
||||
protected Entity\ApiGenerator\StationQueueApiGenerator $queueApiGenerator,
|
||||
protected Entity\Repository\StationQueueRepository $queueRepo,
|
||||
EntityManagerInterface $em,
|
||||
App\Doctrine\ReloadableEntityManagerInterface $em,
|
||||
Serializer $serializer,
|
||||
ValidatorInterface $validator,
|
||||
) {
|
||||
|
|
Loading…
Reference in New Issue