2009年7月15日星期三

[fw-db] Joining several tables using relationships

Hello all,

I looked through other posts but haven't found the solution to my problem.

I have let's say:

- a project table
- an action table.

Both of them are in a many to many relationship (a project can contain
several actions and an action can belong to several projects) Thus I have a
third intersection table called "actionproject" that is doing the linking
between the projects and actions. I use the findManyToManyRowset() method to
retrieve for instance the actions related to a certain project.

Now the complicated part os that I also have a table "users" which can also
be linked to both tables (project and actions) in a many-to-many
relationship. A user can only access an object if he is linked to it.

Now my problem is, can I fetch only the actions of a project that are
accessible by a certain user, using this findManyToManyRowset() method?

What is the most proper way to achieve that?

Thanks a lot in advance for your answers!

--
View this message in context: http://www.nabble.com/Joining-several-tables-using-relationships-tp24492976p24492976.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: