2009年1月22日星期四

[fw-db] findManyToManyRowset() return an actual rowset?

Is it possible to return all (or more than one) row from a Many-to-Many relationship with Zend_Db_Table?

I'm trying to do the following SQL statement basically:
 select * from auth.roles t1 left join auth.roles_resources t2 on t1.id = t2.role_id left join auth.resources t3 on t2.resource_id = t3.id 
With the following schema:


As it stands I would have to loop through each $roleRow->find($role_id) and create some array of row objects (which would run x number of sql calls instead of one) using the following:
         $roleTable = new Auth_Model_DbTable_Roles();          $roleRow = $roleTable->fetchAll();          $role = $roleRow->current();          $resourcePrivileges = $role->findManyToManyRowset(         				'Auth_Model_DbTable_Resources',                         'Auth_Model_DbTable_RolesResources',                         'Role'); 


View this message in context: findManyToManyRowset() return an actual rowset?
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: