[xoops-cvslog 3137] CVS update: xoops2jp/html/modules/legacyRender/class

Back to archive index

Minahito minah****@users*****
2006年 5月 25日 (木) 14:20:55 JST


Index: xoops2jp/html/modules/legacyRender/class/tplfile.php
diff -u xoops2jp/html/modules/legacyRender/class/tplfile.php:1.1.2.10 xoops2jp/html/modules/legacyRender/class/tplfile.php:1.1.2.11
--- xoops2jp/html/modules/legacyRender/class/tplfile.php:1.1.2.10	Wed May 17 20:16:16 2006
+++ xoops2jp/html/modules/legacyRender/class/tplfile.php	Thu May 25 14:20:55 2006
@@ -35,7 +35,13 @@
 		}
 	}
 	
-	function &createClone($name)
+	/**
+	 * Create the clone with source for the template set that is specified by $tplsetName.
+	 * 
+	 * @param $tplsetName string
+	 * @return object LegacyRenderTplfileObject
+	 */
+	function &createClone($tplsetName)
 	{
 		$this->loadSource();
 		
@@ -44,7 +50,7 @@
 		$obj->set('tpl_refid', $this->get('tpl_refid'));
 		$obj->set('tpl_module', $this->get('tpl_module'));
 
-		$obj->set('tpl_tplset', $name);
+		$obj->set('tpl_tplset', $tplsetName);
 
 		$obj->set('tpl_file', $this->get('tpl_file'));
 		$obj->set('tpl_desc', $this->get('tpl_desc'));
@@ -157,6 +163,12 @@
 		return parent::delete($obj, $force);
 	}
 	
+	/**
+	 * This is a kind of getObjects(). Return objects that were modified recently.
+	 * 
+	 * @param $limit int
+	 * @return array array of the object
+	 */
 	function &getRecentModifyFile($limit = 10)
 	{
 		$criteria = new Criteria('tpl_id', 0, '>');
@@ -170,6 +182,38 @@
 		
 		return $objs;
 	}
+	
+	/**
+	 * This is a kind of getObjects(). Call getObjects() by 5 parameters and return
+	 * the result. Parameters are guaranteed Type Safe because these are used by
+	 * getObjects() for XoopsSimpleObject.
+	 * 
+	 * @param $tplsetName string
+	 * @param $type       string
+	 * @param $refId      int
+	 * @param $module     string
+	 * @param $file       string
+	 * @return array      array of the object.
+	 */
+	function &find($tplsetName, $type = null, $refId = null, $module = null, $file = null) {
+		$criteria =& new CriteriaCompo();
+		$criteria->add(new Criteria('tpl_tplset', $tplsetName));
+		if ($type != null) {
+			$criteria->add(new Criteria('tpl_type', $type));
+		}
+		if ($refId != null) {
+			$criteria->add(new Criteria('tpl_refid', $refId));
+		}
+		if ($module != null) {
+			$criteria->add(new Criteria('tpl_module', $module));
+		}
+		if ($file != null) {
+			$criteria->add(new Criteria('tpl_file', $file));
+		}
+		
+		$objs =& $this->getObjects($criteria);
+		return $objs;
+	}
 }
 
 ?>


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