【问题标题】:what is going to be the output of a doctrine 1.2 join学说 1.2 连接的输出将是什么
【发布时间】:2015-03-31 10:41:20
【问题描述】:

左连接后如何处理生成的对象我得到什么样的对象

            $q = Doctrine_Query::create()
            ->from('Student s')
            ->leftJoin('s.Book b')
            ->where('s.std_number=?',$stdNumber);
        $studentBookCollection = $q->execute();

假设 Student 对象具有 getName() 、getAge() 等函数。而 Book 对象具有 getPublisher()、getYear() ,这两个具有多对多关系并具有关系表。

我如何使用 $studentBookCollection 来获取有关图书或学生的信息。

【问题讨论】:

    标签: php sql orm doctrine-1.2


    【解决方案1】:

    它返回了一个学生对象,我可以使用 getBooks() 获取书籍

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-17
      • 2011-02-10
      • 1970-01-01
      相关资源
      最近更新 更多