Quantcast
Channel: Select One column Doctrine DQL - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Select One column Doctrine DQL

$
0
0

I need a simple column for a table.

By example a table "project", with column id, name and year.

If I do:

$q = Doctrine_Query::create()        ->select('a.pro_id')        ->from('fndr_proyecto a')        ->where('a.pro_id =?',1);    $pro = $q->execute();    json_encode($pro->toArray());

The answer is all column like

{"id":1,"name":"Project name","year":2013}

but I need only one column. I expect:

{"id":1}

It is with DQL because with native SQL work fine.

The ORM is build automaticaly with a Visual Paradigm.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images