1

I was used to work with Zend Db Table Relationships with MySQL. I declared $_dependentTables and $_referenceMap in the table classes as described in the manual. Then was able to work with functions findDependentRowset(), findParentRow() etc.

Now I use PostgreSQL, which is able to define the relations (REFERENCES) between tables right in the database.

The manual states:

Skip declaration of $_dependentTables if you use referential integrity constraints in the RDBMS server to implement cascading operations

what should be the case of Postgres. Despite this, I am not able to get it working. Unless I declare the referenceMap (but this shouldn't be needed!), I am still getting error:

No reference from table ... to table ...

The question is - is it possible to use references declared in Postgres in Zend Db, without (re-)declaring them in referenceMap? How - does ZF load it from Postgres to the referenceMap? If so, why I am getting the error?

2
  • are you actually using the "referential integrity constraints" in postgre? Anyway this statement refers more to the cascading operations used with ON UPDATE and ON DELETE not the relationships themseleves. click the link in "See this chapter for more information" Either way it's not really clear what the issues are. Commented Mar 19, 2012 at 22:09
  • Yes, the constrains are defined on DB level (foreign keys are specified by REFERENCES). But you may have the point that the statement only applies to cascading operations, not to the relations. Anyone can confirm that? Commented Mar 20, 2012 at 0:49

1 Answer 1

0

My reading of the linked documentation is that these two address something different.

The DRI in the db recommendation is a recommendation to specify ON UPDATE CASCADE and ON DELETE CASCADE operations in the db rather than telling Zend to cascade.

What you are doing is something different, which is to use the referential integrity mapping to fetch related rows. In this case, it looks like Zend requires that you declare it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.