symfony 1.4 Doctrine toArray()

object->toArray($deep)
$deep为true时,将关联数据也转换为数组

$user = $q->leftJoin('Books')->where(...)->fetchOne();
$user->toArray(true)

echo $user['name']
echo $user['Books']['id']
This entry was posted in Doctrine, Uncategorized. Bookmark the permalink.

Comments are closed.