public function processEdit(Zikula_ProcessHook $hook) { // will need this to update URLs in table // get db table and column for where statement ModUtil::dbInfoLoad('EZComments'); $tables = DBUtil::getTables(); $column = $tables['EZComments_column']; $mod = DataUtil::formatForStore($hook->getCaller()); $objectid = DataUtil::formatForStore($hook->getId()); $areaid = DataUtil::formatForStore($hook->getAreaId()); $where = "{$column['modname']} = '{$mod}' AND {$column['objectid']} = '{$objectid}' AND {$column['areaid']} = '{$areaid}'"; $objUrl = $hook->getUrl()->getUrl(null, null, false, false); // objecturl provided by subscriber // the fourth arg is forceLang and if left to default (true) then the url is malformed - core bug as of 1.3.0 $comment = array('url' => System::getHomepageUrl() . DataUtil::formatForStore($objUrl)); DBUtil::updateObject($comment, 'EZComments', $where); }
/** * Example delete process hook handler. * * The subject should be the object that was deleted. * args[id] Is the is of the object * args[caller] is the name of who notified this event. * * @param Zikula_ProcessHook $hook The hookable event. * * @return void */ public function process_delete(Zikula_ProcessHook $hook) { delete("where id = {$hook->getId()} AND module = {$hook->getCaller()}"); }