I have the following table
Test:
tableName: test
columns:
test_id:
name: test_id as id
primary: true
autoincrement: true
type: integer
notnull: true
test_name:
name: test_name as name
type: string(255)
test_title:
name: test_title as title
type: string(255)
and this dql statement
$dql = Doctrine_Query::create()->select('t.name')->from('Model_Test t');
next sql ist generated
SELECT t.test_id AS t__test_id, t.test_name AS t__test_name FROM test t
but after receiving the result in the doctrine, I have access to the header field, even if it is not selected:
foreach ($results as $result) {
foreach ($result as $filed => $value) {
echo "$filed => $value <hr>";
}
}
also dump via Zend_Debug :: dump ($ results-> toArray ()); shows me all the fields, as if I made a choice *
So, how to limit the returned fields according to my choice?
Thanks in advance
Martin
source
share