Skip to content

Instantly share code, notes, and snippets.

@theodorDiaconu
Last active December 16, 2015 06:08
Show Gist options
  • Save theodorDiaconu/5388945 to your computer and use it in GitHub Desktop.
Save theodorDiaconu/5388945 to your computer and use it in GitHub Desktop.
<?php
public function findNewTasksForUser($id)
{
return
$this->createQueryBuilder('t')
->where('t.taskAdmin = :id AND t.properties & :admin_new_message = :admin_new_message
AND t.properties & :admin_new_task = :admin_new_task')
->orWhere('t.taskDuer = :id AND t.properties & :duer_new_message = :duer_new_message
AND t.properties & :duer_new_message = :duer_new_message')
->setParameters(array(
'id' => $id,
'admin_new_message' => Task::P_NEW_MESSAGE_FOR_ADMIN,
'admin_new_task' => Task::P_NEW_TASK_FOR_ADMIN,
'duer_new_message' => Task::P_NEW_MESSAGE_FOR_DUER,
'duer_new_task' => Task::P_NEW_TASK_FOR_DUER
))
->andWhere('t.isVirtual = false')
->orderBy('t.createdAt', 'DESC')
->getQuery()
->getResult()
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment