public function findBy(array $criteria)
{
$result = new ArrayObject();
$em = $this->getEntityManager();
$storage = $em->getStorage($this->getReflectionClassName());
foreach ($storage as $obj) {
$c = true;
foreach ($criteria as $propertyName => $value) {
$fn = 'get' . ucfirst($propertyName);
if ($obj->{$fn}() !== $value) {
$c = false;
break;
}
}
if ($c === true) {
$result->append($obj);
}
}
return $result;
}