[xoops-cvslog 5036] CVS update: xoops2jp/html/modules/user/class

Back to archive index

Minahito minah****@users*****
2006年 10月 14日 (土) 20:28:34 JST


Index: xoops2jp/html/modules/user/class/mailjob_link.php
diff -u xoops2jp/html/modules/user/class/mailjob_link.php:1.1.2.3 xoops2jp/html/modules/user/class/mailjob_link.php:1.1.2.3.2.1
--- xoops2jp/html/modules/user/class/mailjob_link.php:1.1.2.3	Thu Apr 27 19:25:47 2006
+++ xoops2jp/html/modules/user/class/mailjob_link.php	Sat Oct 14 20:28:34 2006
@@ -8,6 +8,8 @@
 	{
 		$this->initVar('mailjob_id', XOBJ_DTYPE_INT, '0', true);
 		$this->initVar('uid', XOBJ_DTYPE_INT, '0', true);
+		$this->initVar('retry', XOBJ_DTYPE_INT, '0', true);
+		$this->initVar('message', XOBJ_DTYPE_STRING, '', false, 255);
 	}
 }
 
@@ -16,6 +18,37 @@
 	var $mTable = "user_mailjob_link";
 	var $mPrimary = "mailjob_id";
 	var $mClass = "UserMailjob_linkObject";
+	
+	function &get($mailjob_id, $uid)
+	{
+		$ret = null;
+
+		$criteria =& new CriteriaCompo();
+		$criteria->add(new Criteria('mailjob_id', $mailjob_id));
+		$criteria->add(new Criteria('uid', $uid));
+
+		$objArr =& $this->getObjects($criteria);
+		
+		if (count($objArr) == 1) {
+			$ret =& $objArr[0];
+		}
+
+		return $ret;
+	}
+	
+	function delete(&$obj, $force = false)
+	{
+		//
+		// Because Criteria can generate the most appropriate sentence, use
+		// criteria even if this approach is few slow.
+		//
+		$criteria =& new CriteriaCompo();
+		$criteria->add(new Criteria('mailjob_id', $obj->get('mailjob_id')));
+		$criteria->add(new Criteria('uid', $obj->get('uid')));
+		$sql = "DELETE FROM " . $this->mTable . " WHERE " . $this->_makeCriteriaElement4sql($criteria, $obj);
+
+		return $force ? $this->db->queryF($sql) : $this->db->query($sql);
+	}
 }
 
 ?>


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