Ouhaa merci gillessr ca fonctionne ! <3
Ca fonctionne si je mets une seule valeur (que se soit dans un array ou pas).
$tags1 = [1];
$result = $this->getDoctrine()
->getRepository(Articles::class)
->findMyArticles($tags1);
Mais je je veux utiliser plusieurs valeurs dans $tag1 par exemple
$tags1 = [1, 2];
$result = $this->getDoctrine()
->getRepository(Articles::class)
->findMyArticles($tags1);
An exception occurred while executing 'SELECT a0_.id AS id0, a0.title AS title1, a0.slug AS slug2, a0.content AS content3, a0.created_at AS created_at4, a0.updated_at AS updated_at5, a0.active AS active6, a0.description AS description7, a0.image_description AS image_description8, a0.featured_position AS featured_position9, a0.featured AS featured10, a0.image AS image11, a0.views AS views12, a0.author_id AS author_id13, a0.categories_id AS categories_id14 FROM articles a0 LEFT JOIN articlestag a2 ON a0.id = a2.articlesid LEFT JOIN tag t1 ON t1.id = a2.tagid WHERE t1.id = ?, ?' with params [1, 2]:
SQLSTATE[42000]: Syntax error or access violation: 1064 Erreur de syntaxe près de ' 2' à la ligne 1
erreur.. Il faudrait que je fasse une boucle dans la fonction de mon repo?