/** * The event which runs before deleting a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record to delete * * @return boolean True to allow the deletion */ public function onBeforeDelete(&$table, $oid) { $aliasParts = explode('.', $table->getContentType()); if (JComponentHelper::getParams($aliasParts[0])->get('save_history', 0)) { $historyHelper = new JHelperContenthistory($table->getContentType()); $historyHelper->deleteHistory($table); } return true; }
/** * The event which runs before deleting a record * * @param DataModel &$model The model which calls this event * @param integer $oid The PK value of the record to delete * * @return boolean True to allow the deletion */ public function onBeforeDelete(&$model, $oid) { $aliasParts = explode('.', $model->getContentType()); if (\JComponentHelper::getParams($aliasParts[0])->get('save_history', 0)) { if (!$this->historyHelper) { $this->historyHelper = new \JHelperContenthistory($model->getContentType()); } $this->historyHelper->deleteHistory($model); } return true; }
/** * Pre-processor for $table->delete($pk) * * @param mixed $pk An optional primary key value to delete. If not set the instance property value is used. * * @return void * * @since 3.2 * @throws UnexpectedValueException */ public function onBeforeDelete($pk) { $this->parseTypeAlias(); $aliasParts = explode('.', $this->contenthistoryHelper->typeAlias); if (JComponentHelper::getParams($aliasParts[0])->get('save_history', 0)) { $this->parseTypeAlias(); $this->contenthistoryHelper->deleteHistory($this->table); } }