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');
the following sql ist generated
SELECT t.test_id AS t__test_id, t.test_name AS t__test_name FROM test t
but after fetching the result in doctrine, I have access to the title field even it is not selected:
foreach ($results as $result) {
foreach ($result as $filed => $value) {
echo "$filed => $value <hr>"; // echoes 'title' => null but title in db has other value
}
}
also a dump via Zend_Debug::dump($results->toArray()); shows me all fields as if I would have done a select *
So how to limit the returned fields to match my selection?
Thanks in advance
Martin