[xoops-cvslog 3773] CVS update: xoops2jp/html/modules/base/class

Back to archive index

Minahito minah****@users*****
2006年 7月 31日 (月) 19:22:13 JST


Index: xoops2jp/html/modules/base/class/comment.php
diff -u xoops2jp/html/modules/base/class/comment.php:1.1.2.8 xoops2jp/html/modules/base/class/comment.php:1.1.2.9
--- xoops2jp/html/modules/base/class/comment.php:1.1.2.8	Fri Apr 14 15:02:09 2006
+++ xoops2jp/html/modules/base/class/comment.php	Mon Jul 31 19:22:13 2006
@@ -73,15 +73,29 @@
 	var $mTable = "xoopscomments";
 	var $mPrimary = "com_id";
 	var $mClass = "BaseCommentObject";
+
+	/**
+	 * @var XCube_NewDelegate
+	 */	
+	var $mUpdateSuccess;
+	
+	/**
+	 * @var XCube_NewDelegate
+	 */	
+	var $mDeleteSuccess;
+	
+	function BaseCommentHandler(&$db)
+	{
+		parent::XoopsObjectGenericHandler($db);
+		
+		$this->mUpdateSuccess =& new XCube_NewDelegate();
+		$this->mDeleteSuccess =& new XCube_NewDelegate();
+	}
 	
 	function insert(&$comment, $force = false)
 	{
 		if (parent::insert($comment, $force)) {
-			$root =& XCube_Root::getSingleton();
-			$eventArgs = array();
-			$eventArgs['comment'] =& $comment;
-			$root->mEventManager->raiseEvent('Module.Legacy.Comment.Update.Success', $this, $eventArgs);
-			
+			$this->mUpdateSuccess->call($comment);
 			return true;
 		}
 		else {
@@ -98,10 +112,8 @@
 		$this->deleteAll($criteria);
 		
 		if (parent::delete($comment, $force)) {
-			$root =& XCube_Root::getSingleton();
-			$eventArgs = array();
-			$eventArgs['comment'] =& $comment;
-			$root->mEventManager->raiseEvent('Module.Legacy.Comment.Delete.Success', $this, $eventArgs);
+			$this->mDeleteSuccess->call($comment);
+			return true;
 		}
 		else{
 			return false;


xoops-cvslog メーリングリストの案内
Back to archive index