I was trying to a run raw sql query with doctrine entitymanager for IN clause as shown below.
$idSArray = Array ( [0] => 1 [1] => 2 )
$stm
@Hast The second code block you posted works. Adding a new answer so future viewers can reference...
$ids = [1,2];
$sql = "SELECT t1.id , t1.name , t2.start_date , t2.end_date
FROM table1 t1 , table2 t2
WHERE t1.id = t2.matchId AND t1.id IN (?)";
$stmt = $this->getEntityManager()->getConnection()->executeQuery(
$sql,
[$ids],
[\Doctrine\DBAL\Connection::PARAM_INT_ARRAY] // for an array of strings use PARAM_STR_ARRAY
);
$data = $stmt->fetchAll();