Skip to content

Instantly share code, notes, and snippets.

@Shagshag
Created June 24, 2013 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shagshag/5850617 to your computer and use it in GitHub Desktop.
Save Shagshag/5850617 to your computer and use it in GitHub Desktop.
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;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment