Is it possible to change findBy*
method to return an object (my custom) with entities instead of an array?
Use findOneBy instead of findBy. findOneBy is return as an object.
http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.EntityRepository.html
$obj = $this
->getDoctrine()
->getRepository("VendorXXXBundle:EntityName")
->findOneBy(array $criteria)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With