zend relationships with select

前端 未结 2 1854
醉话见心
醉话见心 2021-01-06 03:47

I am new to zend. I have been asked to redevelop a website that was once written in plain PHP and put it into the zend framework.

I am having a lot of trouble with d

2条回答
  •  無奈伤痛
    2021-01-06 03:55

    Everything looks correctly to me. You don't query a dependent rowset. It is a query itself and it returns a result set. Basically what it is doing is pulling all records related to the current row you are working with as defined by $_referenceMap. Once you execute findDependentRowset(), you can foreach over the results which will give you instances of Zend_Db_Table_Row. From there you can display the related data as needed.

    Personally I don't use Zend_Db Relationships. It is much easier to just make a second model method to query what I need. Also, Zend_Db Relationships do not support where clauses, so just making a second query is much more flexible than relationships.

提交回复
热议问题