|
@@ -6,17 +6,14 @@ namespace App\State\Provider\Freemium;
|
|
|
|
|
|
|
|
use ApiPlatform\Metadata\GetCollection;
|
|
use ApiPlatform\Metadata\GetCollection;
|
|
|
use ApiPlatform\Metadata\Operation;
|
|
use ApiPlatform\Metadata\Operation;
|
|
|
-use ApiPlatform\State\Pagination\PaginatorInterface;
|
|
|
|
|
use ApiPlatform\State\Pagination\TraversablePaginator;
|
|
use ApiPlatform\State\Pagination\TraversablePaginator;
|
|
|
use ApiPlatform\State\ProviderInterface;
|
|
use ApiPlatform\State\ProviderInterface;
|
|
|
-use ApiPlatform\Metadata\IriConverterInterface;
|
|
|
|
|
use App\ApiResources\Freemium\FreemiumEvent;
|
|
use App\ApiResources\Freemium\FreemiumEvent;
|
|
|
-use App\ApiResources\Freemium\FreemiumPlace;
|
|
|
|
|
use App\Entity\Booking\Event;
|
|
use App\Entity\Booking\Event;
|
|
|
-use App\Entity\Core\Categories;
|
|
|
|
|
use App\Repository\Booking\EventRepository;
|
|
use App\Repository\Booking\EventRepository;
|
|
|
use App\Service\Doctrine\FiltersConfigurationService;
|
|
use App\Service\Doctrine\FiltersConfigurationService;
|
|
|
use App\State\Provider\ProviderUtils;
|
|
use App\State\Provider\ProviderUtils;
|
|
|
|
|
+use Doctrine\Common\Collections\ArrayCollection;
|
|
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
|
use Symfony\Component\ObjectMapper\ObjectMapperInterface;
|
|
use Symfony\Component\ObjectMapper\ObjectMapperInterface;
|
|
|
|
|
|
|
@@ -84,7 +81,13 @@ final class FreemiumEventProvider implements ProviderInterface
|
|
|
$this->filtersConfigurationService->restoreTimeConstraintFilters();
|
|
$this->filtersConfigurationService->restoreTimeConstraintFilters();
|
|
|
|
|
|
|
|
$freemiumEvent = $this->objectMapper->map($event, FreemiumEvent::class);
|
|
$freemiumEvent = $this->objectMapper->map($event, FreemiumEvent::class);
|
|
|
- $freemiumEvent->categories = $event->getCategories();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //Afin de s'assurer que les catégories ne sont plus directement liées à l'Event source.
|
|
|
|
|
+ $categories = new ArrayCollection();;
|
|
|
|
|
+ foreach ($event->getCategories() as $cat){
|
|
|
|
|
+ $categories->add($cat);
|
|
|
|
|
+ }
|
|
|
|
|
+ $freemiumEvent->categories = $categories;
|
|
|
|
|
|
|
|
return $freemiumEvent;
|
|
return $freemiumEvent;
|
|
|
}
|
|
}
|