Member-only story

Povilas Brilius
2 min readFeb 23, 2021

I think that college training hasn’t reached Doctrine ORM — because its DQL querying returns empty set of results, howsoever weird it is.

Daan Vickie Li

Photo by Pascal Brokmeier on Unsplash

It’s not a proud statement, though

$users = $em->createQuery('SELECT u, n FROM ' . User::class . ' AS u JOIN ' . Note::class . ' as n')->getResult();

isn’t working as expected — the associations are fetched in a separate the same level, not nested to collections object. So, dumping isn’t pretty and surveillence unveils CCTV proximity as well as threatening danger.

More convincing stuff is — already — working Doctrine ORM associations fetch — unbelievable!

$users = $em->getRepository(User::class)->findAll();// $users = R::findAll('user');

So, the response is the same as RedBeans instance —

curl --location --request GET 'localhost:2526/index.php/api/v1/user/50'{
"data": [
{
"id": "50",
"email"…
Povilas Brilius
Povilas Brilius

Written by Povilas Brilius

PHP Developer in e-commerce and e-loans industry fields.

No responses yet