Page 1 of 1

db-obj mapping. deleting issue. need advice

Posted: Tue Jan 22, 2008 3:38 am
by jmut
Hi,
Lets imaging I have single object refer to single row sittuation. I want to implement delete feature.
So when I hit $obj->delete() I will delete from db...and at this point object should be obsolete... so any further call (in same http request) of $obj->getSomething() or whatever should result in exception.."object deleted or something"...
This is no issue on next request as will not have such record in db so no such object could be created...

So I am thinking I can put a flag...but then again I should call isDeleted() as first call in each method of object. Thats ok unless it's just something really easy to forget and would like to skip. Any pointers to this problem more than welcome.