Question

Reading the bottom of the documentation, specifically:

"You can still retrieve properties of deleted objects, but you cannot save deleted objects."

How? Is it only if you enable a setting?

Was it helpful?

Solution

I'm not very familiar with the exact workings of Propel. But it is important to understand the difference between the database (MySQL) and the ORM layer (Propel). Propel is an abstraction that represents rows from the database by wrapping them in objects. You may then change or delete such rows by calling a method on the corresponding object and Propel will generate and execute the SQL statement needed.

So, after the SQL DELETE statement was executed the object wrapper will still hold the data that was loaded before the row was deleted. But it will no longer allow you to modify the row data, because there is no place that Propel could write those changes to.

OTHER TIPS

A deleted object is just deleted in the database and flagged as being deleted. You can still access it in php, for example to display some goodbye data to the user ("Product XYZ was deleted").

I think by 'object' it is referring to the object that has already been loaded into memory. It's saying you can still look at its attributes, but if you try to call save it will try to execute an UPDATE SQL statement which will fail because the record has actually been deleted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top