Putting an alias in the partial choice doctrine

Can I use an alias in partial selection? Because I use underscore as a naming convention for variables in the interface and camelCasing in the background.

Here is my doctrine request:

return $this->postingRepo->createQueryBuilder('p') ->select('p.postingId','p.datetimePosted') ->innerJoin('p.user','u') ->addSelect('partial u.{userId as user_id,firstName as first_name,lastName as last_name}') // ----> generates an error message ->orderBy('p.datetimePosted','DESC') ->getQuery() ->getArrayResult(); 

I have searched many times, but still cannot find the answer. Maybe someone knows how or wants to tell me that this is not possible.

+6
source share

Source: https://habr.com/ru/post/982545/


All Articles