Search code examples
mysqlpropel

Deleting queries in mySQL


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?


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.