views:

83

answers:

0

Hi,

I am soft-deleting objects in a MySQL database and using the Propel ORM. I have gotten soft-deleting to work, but at the cost of losing my enforced parent-child relationships, since the actual rows are not being deleted.

Is there any way for Propel to know that a record has been soft-deleted when you access it, so that a null-reference exception is not thrown? This way, although a parent has been deleted, its child can still read it's relation, but when updating a child, or creating a new child, the deleted parent is not accessible.

For example,

Book has an AuthorId, and if the author belonging to AuthorId is soft-deleted, then:

$book->getAuthor();

would return the correct author (for viewing purposes only). However, if a new book was added, the author that was soft-deleted is not available to be selected.

Does anybody know if that functionality is built into Propel?