I had read somewhere some day that symfony2/Doctrine2 has a method(i don't remember the method name now) that fetches all "like" objects that we specify..
For example, I have User entity
that has userName
, password
, name
, state
and city
as properties.. For getting all Users who has name = "vinay"
and state = "karnataka"
, the steps goes like this,,
$user = new User();
$user->setName("vinay");
$user->setState("karnataka");
$query = $em->dontKnowTheMethod($user);
$usersList = $query->getResult();
$usersList
should contain all the users whose name = "vinay"
and state = "karnataka"
I searched for hours but Im not getting that method.. Im sure I had read about that method long back but I cannot recall now..
Thanks in advance..
You should start studying doctrine and symfony.