I have an Attorney Page that has a has_many relationship with Schools. The user adds schools to an attorney through a TableField. In order to tie specific schools to one attorney, I've used the setExtraData() method to put 'AttorneyPageID => $this->ID' on the table.
This works great until I add a new attorney, and I get a SQL error! The $this->ID is of course returning a junk ID... something like "new-attorney-page-id," or something to that effect, and now my filter is erroneous.. e.g. "WHERE AttorneyPageID ='new-attorney-page-id' "..
So i hacked something:
function getTheID() {
return (is_integer($this->ID)) ? $this->ID : 9999;
}
But of course this wont' work in the long run... please help!!