Skip to content

Instantly share code, notes, and snippets.

@nixon1333
Last active February 3, 2018 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nixon1333/7eaaf5333d323b829c1ce1a5e728fdf5 to your computer and use it in GitHub Desktop.
Save nixon1333/7eaaf5333d323b829c1ce1a5e728fdf5 to your computer and use it in GitHub Desktop.
symfomy2 custom query builder
<?php
$repository = $this->getDoctrine()->getManager()->getRepository('ApplicationBundle:AccWorkloadEntry');
$query = $repository->createQueryBuilder('c')->where("c.companyId = ".$this->CompanyID);
$query->andWhere("c.status ='1'");
$query->andWhere("c.reportDate between '".$dateFrom ."' and '".$dateTo."'");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment