summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-03-29 00:30:06 +0100
committerGravatar Martin Szulecki2013-03-29 00:30:06 +0100
commit5493867881a23bce79d0f1f5f01b7214c4784df6 (patch)
treec2c4174af530dee223e0c079f7a4e03ec4fb7b58
parent1ad5e19dde3dcdaf6f5188764726eae9c2d13672 (diff)
downloadmailadmin-5493867881a23bce79d0f1f5f01b7214c4784df6.tar.gz
mailadmin-5493867881a23bce79d0f1f5f01b7214c4784df6.tar.bz2
Clone Criteria for doOnDeleteCascade() to prevent deleting domain permissionsHEADmaster
-rw-r--r--lib/model/DomainPeer.php10
-rw-r--r--lib/model/MailboxPeer.php10
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/model/DomainPeer.php b/lib/model/DomainPeer.php
index f52c6ca..f4c06f3 100644
--- a/lib/model/DomainPeer.php
+++ b/lib/model/DomainPeer.php
@@ -28,6 +28,16 @@ class DomainPeer extends BaseDomainPeer
return parent::doSelectJoinUser($criteria, $con);
}
+ protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
+ {
+ // cloning the Criteria in case it's modified by doSelect() or doSelectStmt()
+ if ($criteria instanceof Criteria) {
+ $c = clone $criteria;
+ }
+
+ return parent::doOnDeleteCascade($c, $con);
+ }
+
public static function getDomainByName($name)
{
$c = new Criteria();
diff --git a/lib/model/MailboxPeer.php b/lib/model/MailboxPeer.php
index 46170c3..4b18d37 100644
--- a/lib/model/MailboxPeer.php
+++ b/lib/model/MailboxPeer.php
@@ -27,4 +27,14 @@ class MailboxPeer extends BaseMailboxPeer
DomainPermissionPeer::addDomainPermissionCriteria($criteria, MailboxPeer::DOMAIN_ID);
return parent::doSelectJoinDomain($criteria, $con);
}
+
+ protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
+ {
+ // cloning the Criteria in case it's modified by doSelect() or doSelectStmt()
+ if ($criteria instanceof Criteria) {
+ $c = clone $criteria;
+ }
+
+ return parent::doOnDeleteCascade($c, $con);
+ }
}