/** * Manages data when an item is saved. */ public function hookAfterSaveItem($args) { $item = $args['record']; // This is done after insert, update or post and only if a function exists // in the custom library. $bookreader = new BookReader($item); $bookreader->saveData(); }