Permalink
Browse files

fix hook method generation

  • Loading branch information...
1 parent e350664 commit 3af06b53ef0b934faf55a6075124f73f33d98762 @jaugustin jaugustin committed with willdurand Jul 27, 2012
@@ -717,7 +717,7 @@ protected function addHookMethods(&$script)
$hooks = array();
foreach (array('pre', 'post') as $hook) {
foreach (array('Insert', 'Update', 'Save', 'Delete') as $action) {
- $hooks[$hook.$action] = false !== strpos($script, "function $hook.$action(");
+ $hooks[$hook.$action] = false === strpos($script, "function $hook.$action(");
}
}
$script .= $this->renderTemplate('baseObjectMethodHook', $hooks);
@@ -68,7 +68,7 @@ public function postUpdate(ConnectionInterface $con = null)
}
<?php endif?>
-<?php if ($postSave):?>
+<?php if ($preDelete):?>
/**
* Code to be run before deleting the object in database
* @param ConnectionInterface $con
@@ -80,7 +80,7 @@ public function preDelete(ConnectionInterface $con = null)
}
<?php endif?>
-<?php if ($postSave):?>
+<?php if ($postDelete):?>
/**
* Code to be run after deleting the object in database
* @param ConnectionInterface $con

0 comments on commit 3af06b5

Please sign in to comment.