I'm working in ModelAdmin with a couple of DataObjects, Project and Deliverables (Projects have many deliverables). I'm managing the Deliverables from inside Project with a DataObjectManager. Each Deliverables has a hidden field nondelete that if set to yes (1) the user should not be able to delete the record.
I thought that in my Deliveable class I could just set something like:
function canDelete() {
if($this->nondelete == 1) {
return false;
}
}
I'm not sure how to prevent certain records from being deleted. I also tried a few things using OnBeforeDelete() in Deliverables, but had no luck with that either.
Any help would be appreciated,
Brian