Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback (pre/post, save/update/delete) implementation in base Object #1032

Merged
merged 1 commit into from
Mar 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 25 additions & 5 deletions src/Propel/Generator/Builder/Om/templates/baseObjectMethodHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*/
public function preSave(ConnectionInterface $con = null)
{
if (is_callable('parent::preSave')) {
return parent::preSave($con);
}
return true;
}

Expand All @@ -18,7 +21,9 @@ public function preSave(ConnectionInterface $con = null)
*/
public function postSave(ConnectionInterface $con = null)
{

if (is_callable('parent::postSave')) {
parent::postSave($con);
}
}

<?php endif?>
Expand All @@ -30,6 +35,9 @@ public function postSave(ConnectionInterface $con = null)
*/
public function preInsert(ConnectionInterface $con = null)
{
if (is_callable('parent::preInsert')) {
return parent::preInsert($con);
}
return true;
}

Expand All @@ -41,7 +49,9 @@ public function preInsert(ConnectionInterface $con = null)
*/
public function postInsert(ConnectionInterface $con = null)
{

if (is_callable('parent::postInsert')) {
parent::postInsert($con);
}
}

<?php endif?>
Expand All @@ -53,6 +63,9 @@ public function postInsert(ConnectionInterface $con = null)
*/
public function preUpdate(ConnectionInterface $con = null)
{
if (is_callable('parent::preUpdate')) {
return parent::preUpdate($con);
}
return true;
}

Expand All @@ -64,7 +77,9 @@ public function preUpdate(ConnectionInterface $con = null)
*/
public function postUpdate(ConnectionInterface $con = null)
{

if (is_callable('parent::postUpdate')) {
parent::postUpdate($con);
}
}

<?php endif?>
Expand All @@ -76,6 +91,9 @@ public function postUpdate(ConnectionInterface $con = null)
*/
public function preDelete(ConnectionInterface $con = null)
{
if (is_callable('parent::preDelete')) {
return parent::preDelete($con);
}
return true;
}

Expand All @@ -87,7 +105,9 @@ public function preDelete(ConnectionInterface $con = null)
*/
public function postDelete(ConnectionInterface $con = null)
{

if (is_callable('parent::postDelete')) {
parent::postDelete($con);
}
}

<?php endif?>
<?php endif?>