Skip to content

Instantly share code, notes, and snippets.

@IvanAlekseevichPopov
Last active April 17, 2018 15:23
Show Gist options
  • Save IvanAlekseevichPopov/f6692a4a31ccbc92618dfefaa805652a to your computer and use it in GitHub Desktop.
Save IvanAlekseevichPopov/f6692a4a31ccbc92618dfefaa805652a to your computer and use it in GitHub Desktop.
in query with array as parameter
use Doctrine\DBAL\Connection;
...
return $this
->getEntityManager()
->getConnection()
->executeQuery(
'SELECT * from posts WHERE id IN (?)',
[$postIdCollection],
[Connection::PARAM_INT_ARRAY]
)
->fetchAll(\PDO::FETCH_UNIQUE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment