Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix hook method generation

  • Loading branch information...
commit 3af06b53ef0b934faf55a6075124f73f33d98762 1 parent e350664
@jaugustin jaugustin authored willdurand committed
View
2  src/Propel/Generator/Builder/Om/ObjectBuilder.php
@@ -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);
View
4 src/Propel/Generator/Builder/Om/templates/baseObjectMethodHook.php
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.