The status of a DO can be checked with the following methods:
isDeleted()
Returns true if the object is deleted in the transaction, andh the transaction was not yet committed.
get_transaction()
Returns transaction to which the DO belongs to. If the DO does not have a transaction, NULL is returned.
isLoaded()
Returns true if DO's data is loaded from database (DO is not empty), otherwise false.
isReadOnly()
Return true if the data for this DO has been marked read-only, otherwise false.
isVirgin()
Returns true for a DO that is created virgin, and hasn't been commited.
isDirty()
Returns true if this object has been modified (needs to be updated to the database).