8

is there a way to use the findAll() function with conditions?

I want to do something like

->findAll('active'=1);

I know that i can write custom repository classes but just for a simple "where-condition" I thought there is an easier way.

j0k
  • 22,600
  • 28
  • 79
  • 90
Michael
  • 95
  • 1
  • 1
  • 4

1 Answers1

23

You can use findBy:

$objects = $yourRepo -> findBy(array('key' => $value ));
moonwave99
  • 21,957
  • 3
  • 43
  • 64