Images for NotConserved
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Controller;
|
||||
|
||||
use App\Entity\NotConserved;
|
||||
use App\Entity\Bibliography;
|
||||
use App\Entity\Image;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
@@ -49,6 +50,13 @@ class NotConservedController extends AbstractController
|
||||
|
||||
$notConserved->setLat($coordinates['lat']);
|
||||
$notConserved->setLng($coordinates['lng']);
|
||||
$repo = $em->getRepository(Image::class);
|
||||
$images = $repo->findBy(
|
||||
['notConserved' => $notConserved->getId()],
|
||||
['sequence' => 'ASC']
|
||||
);
|
||||
|
||||
$notConserved->setImages($images);
|
||||
|
||||
return $this->json(
|
||||
$notConserved,
|
||||
|
||||
Reference in New Issue
Block a user