在左联接后,我如何处理生成的对象?我得到什么样的对象
$q = Doctrine_Query::create()
->from('Student s')
->leftJoin('s.Book b')
->where('s.std_number=?',$stdNumber);
$studentBookCollection = $q->execute();
比如Student对象有getName()、getAge()和Book对象have getPublisher()、getYear()等函数,这两个函数有多对多关系,并且有一个关系表。
如何使用$studentBookCollection获取有关该书或该学生的信息。
它返回了一个学生对象,我可以通过使用getBooks()来获取书籍