I have following repository:
public function findClassPhotoByPath($path)
{
return $this->getEntityManager()
->createQuery('SELECT p FROM KSRGalleryBundle:Photo p WHERE p.category = :category AND p.path = :path')
->setParameters(array('category' => 'class_photo', 'path' => $path))
->setMaxResults(1)
->getResult();
}
When I now use this repository-method the object is inside an array and I have to access it through $photo[0].
Is it possible to fetch the direct directly how it is the case by findOneBy()?
Best Regards, bodo