From 5493867881a23bce79d0f1f5f01b7214c4784df6 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 29 Mar 2013 00:30:06 +0100 Subject: Clone Criteria for doOnDeleteCascade() to prevent deleting domain permissions --- lib/model/MailboxPeer.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/model/MailboxPeer.php') 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); + } } -- cgit v1.1-32-gdbae