Skip to content

Instantly share code, notes, and snippets.

@pix-art
Created March 4, 2016 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pix-art/99c565a59f5ce6ecaa2d to your computer and use it in GitHub Desktop.
Save pix-art/99c565a59f5ce6ecaa2d to your computer and use it in GitHub Desktop.
QB Example
$query = $this->em->getConnection()->createQueryBuilder()
->select('a.*')
->from('asset', 'a');
if ($type) {
$query->andWhere('a.type = :type')
->setParameter('type', $type);
}
$assets = $query->execute()->fetchAll();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment