Monthly Archives: September 2016

Doctrine 2 QueryBuilder getResult and getArrayResult

When using Doctrine 2 hydration you can sometimes encounter issue when you get one result instead of many results. Doctrine 2  requires every entity to have Id annotation. Please use it carefully, because when using Doctrine 2 QueryBuilder \Doctrine\ORM\AbstractQuery::getResult You will not get records having not unique @Id fields. And no even PHP warnings. \Doctrine\ORM\Internal\Hydration\ObjectHydrator::hydrateRowData will […]