Override example with Prestashop
<?php
class ObjectModel extends ObjectModelCore
{
public function add($autodate = true, $nullValues = false)
{
$result = parent::add($autodate, $nullValues);
if ($result) Module::hookExec('objectAdd', array('object' => $this));
return $result;
}
public function update($autodate = true, $nullValues = false)
{
$result = parent::update($autodate, $nullValues);
if ($result) Module::hookExec('objectUpdate', array('object' => $this));
return $result;
}
public function delete($autodate = true, $nullValues = false)
{
$result = parent::delete($autodate, $nullValues);
if ($result) Module::hookExec('objectDelete', array('object' => $this));
return $result;
}
}
?>