Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getCages($query, cageQueryParams $params)
- {
- $q = $this->createQuery('c')
- ->leftJoin('c.Strain s')
- ->leftJoin('c.MouseCage m')
- ->where('m.dateout IS NULL');
- if($params->strainid) {
- $q->addWhere('c.strain_id = ?', $params->strainid);
- }
- if($params->projectlicenceid) {
- $q->addWhere('c.project_licence_id = ?', $params->projectlicenceid);
- }
- //lots more ifs here
- $q->andWhere('c.is_active = ?', '1')
- ->addOrderBy('c.number DESC')
- ->limit(10);
- return $q->execute();
- }
Add Comment
Please, Sign In to add comment