у меня есть 3 таблицы: Exercice, Tag, Tag_Exercice (отношение ManyToMany)
у каждого может быть много тегов, и каждый тег может использоваться многими упражнениями.
используя Doctrine, я хочу выбрать все теги, которые не используются в упражнении.
class ExerciceRepository extends EntityRepository
{
public function notusedtags() {
$entityManager = $this->getEntityManager();
return $entityManager->createQuery("select t,te from App\Entity\Tag
t left join t.Exercices te where te.id<>7 or te.id is null")
->getresult();
}