Skip to content

Instantly share code, notes, and snippets.

@ABM-Dan
Created September 12, 2016 21:09
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 ABM-Dan/87073261350c13e293b62a4051b648fe to your computer and use it in GitHub Desktop.
Save ABM-Dan/87073261350c13e293b62a4051b648fe to your computer and use it in GitHub Desktop.
public function pruneEntitiesOlderThan($cutoffTime)
{
return $this->createQueryBuilder('w')
->delete()
->join('w.lot', 'l')
->where('l.sale_date < :cutoff_time')
->setParameter('cutoff_time', strtotime('-'.$cutoffTime.' day'))
->getQuery()
->getResult();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment