Skip to content

Instantly share code, notes, and snippets.

@rgazelot
Created October 19, 2017 09:11
Show Gist options
  • Save rgazelot/88593a0199e6bff0092d5a4fc011f4d8 to your computer and use it in GitHub Desktop.
Save rgazelot/88593a0199e6bff0092d5a4fc011f4d8 to your computer and use it in GitHub Desktop.
Query builder current meetings
$qb->andWhere($qb->expr()->orX(
$qb->expr()->andX(
$qb->expr()->gte('e.start', ':from'),
$qb->expr()->lte('e.start', ':until')
),
$qb->expr()->andX(
$qb->expr()->gte('e.stop', ':from'),
$qb->expr()->lte('e.stop', ':until')
),
$qb->expr()->andX(
$qb->expr()->lte('e.start', ':from'),
$qb->expr()->gte('e.stop', ':until')
)
))
->setParameter('from', $from)
->setParameter('until', $until)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment