ref 3016. Updated ogRepository sync
parent
1b24414c0c
commit
52515633af
|
|
@ -80,6 +80,18 @@ class SyncAction extends AbstractOgRepositoryController
|
|||
|
||||
$this->entityManager->flush();
|
||||
|
||||
$orphanImages = $imageRepo->createQueryBuilder('i')
|
||||
->leftJoin('i.imageImageRepositories', 'iir')
|
||||
->andWhere('iir.id IS NULL')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
foreach ($orphanImages as $orphanImage) {
|
||||
$this->entityManager->remove($orphanImage);
|
||||
}
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
||||
return new JsonResponse(data: $content, status: Response::HTTP_OK);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue