I'm making an inlog form where the user can decide to use this username or email address in combination with its password. So normally it would something like: ((username OR email) AND password) in SQL. Used the following controller code only don't know how to add the OR function.
$user = $this->getDoctrine()
->getRepository('Bundle:CusUser')
->findOneBy(
array('username' => $user->getUsername(), 'email' => $user->getUsername(), 'password' => $user->getPassword())
);
For both is getUsername used as this is the flied in the form.