[icinga-checkins] icinga.org: icinga-web/mhein/reporting: * Added oracle fix for deleting cronks

git at icinga.org git at icinga.org
Wed Jul 6 17:22:55 CEST 2011


Module: icinga-web
Branch: mhein/reporting
Commit: 261fad312db6a7c6b749d3ecf54531d2c62267a6
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=261fad312db6a7c6b749d3ecf54531d2c62267a6

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Jul  6 14:10:22 2011 +0200

* Added oracle fix for deleting cronks

---

 .../models/Provider/CronksDataModel.class.php      |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/app/modules/Cronks/models/Provider/CronksDataModel.class.php b/app/modules/Cronks/models/Provider/CronksDataModel.class.php
index a45796f..8de012c 100755
--- a/app/modules/Cronks/models/Provider/CronksDataModel.class.php
+++ b/app/modules/Cronks/models/Provider/CronksDataModel.class.php
@@ -546,9 +546,24 @@ class Cronks_Provider_CronksDataModel extends CronksBaseModel {
 		$cronk = $q->execute()->getFirst();
 		
 		if ($cronk instanceof Cronk && $cronk->cronk_id > 0) {
+		    $this->getContext()->getLoggerManager()->log(sprintf('Cronk::DELETE preare to delete %s (%s)', $cronkid, $cronkname), AgaviLogger::INFO);
+		    
 			Doctrine_Manager::getInstance()->getCurrentConnection()->beginTransaction();
-			$cronk->CronkCategoryCronk->delete();
-			$cronk->CronkPrincipalCronk->delete();
+			
+			
+			# $cronk->CronkCategoryCronk->delete();
+			$removed = Doctrine_Query::create()->delete('CronkCategoryCronk')
+			->andWhere('ccc_cronk_id=?', array($cronk->cronk_id))->execute();
+			
+			$this->getContext()->getLoggerManager()->log(sprintf('Cronk::DELETE deleted %d category relations', $removed), AgaviLogger::DEBUG);
+			
+			# $cronk->CronkPrincipalCronk->delete();
+			
+			$removed = Doctrine_Query::create()->delete('CronkPrincipalCronk')
+			->andWhere('cpc_cronk_id=?', array($cronk->cronk_id))->execute();
+			
+			$this->getContext()->getLoggerManager()->log(sprintf('Cronk::DELETE deleted %d principal relations', $removed), AgaviLogger::DEBUG);
+			
 			$cronk->save();
 			Doctrine_Manager::getInstance()->getCurrentConnection()->commit();
 			





More information about the icinga-checkins mailing list