Hi All,
I'm developing a plugin for fengoffice which provides the ability to add a location to an event using google maps.
I'm integrating with Feng Office using the following hooks:
object_edit_categories : add an additional category to edit location to ProjectEvent
render_object_properties : when viewing an event add a static map to the properties section
object_validate : when an event is being saved, validate my location object too, if it doesnt validate then the event object wont save either, great!
My problem is that my location database table needs to use the ProjectEvent id as a foreign key, so i can't save my location object before the Projectevent has been saved and given an Id.
Really need an extra hook: 'after_object_save' to be added to DataObject.class.php line 420 so it reads something like this:
function save() {
$errors = $this->doValidate();
if(is_array($errors)) {
throw new DAOValidationError($this, $errors);
} // if
Hook::fire('before_object_save', $this, $ret);
$didSave = $this->doSave();
Hook::fire('after_object_save', $this, $didSave);
return $didSave;
} // save
Unless im missing something?
I'm developing the plugin for a client but hope to opensource it and add it to the feng office plugins list in the future. Will write a blog post describing how to write a plugin too if anyone's interested (although i may be missing a few things still at the moment)