当前位置: 首页>>代码示例>>PHP>>正文


PHP ADODB_Active_Record::Load方法代码示例

本文整理汇总了PHP中ADODB_Active_Record::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP ADODB_Active_Record::Load方法的具体用法?PHP ADODB_Active_Record::Load怎么用?PHP ADODB_Active_Record::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ADODB_Active_Record的用法示例。


在下文中一共展示了ADODB_Active_Record::Load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: duplicate

	public function duplicate() {
		$dh = Loader::helper('date');
		$db = Loader::db();
		$date = $dh->getSystemDateTime(); 

		$far = new ADODB_Active_Record('Files');
		$far->Load('fID=?', array($this->fID));
		
		$far2 = clone $far;
		$far2->fID = null;
		$far2->fDateAdded = $date;
		$far2->Insert();
		$fIDNew = $db->Insert_ID();

		$fvIDs = $db->GetCol('select fvID from FileVersions where fID = ?', $this->fID);
		foreach($fvIDs as $fvID) {
			$farv = new ADODB_Active_Record('FileVersions');
			$farv->Load('fID=? and fvID = ?', array($this->fID, $fvID));
	
			$farv2 = clone $farv;
			$farv2->fID = $fIDNew;
			$farv2->fvActivateDatetime = $date;
			$farv2->fvDateAdded = $date;
			$farv2->Insert();
		}		

		$r = $db->Execute('select fvID, akID, avID from FileAttributeValues where fID = ?', array($this->getFileID()));
		while ($row = $r->fetchRow()) {
			$db->Execute("insert into FileAttributeValues (fID, fvID, akID, avID) values (?, ?, ?, ?)", array(
				$fIDNew, 
				$row['fvID'],
				$row['akID'], 
				$row['avID']
			));
		}
		
		// return the new file object
		return File::getByID($fIDNew);
		
	}
开发者ID:notzen,项目名称:concrete5,代码行数:40,代码来源:file.php

示例2: duplicate

 /** 
  * Duplicates an attribute key 
  */
 public function duplicate($args = array())
 {
     $ar = new ADODB_Active_Record('AttributeKeys');
     $ar->Load('akID=?', array($this->akID));
     $ar2 = clone $ar;
     $ar2->akID = null;
     foreach ($args as $key => $value) {
         $ar2->{$key} = $value;
     }
     $ar2->Insert();
     $db = Loader::db();
     $ak = new AttributeKey();
     $ak->load($db->Insert_ID());
     // now we duplicate the specific category fields
     $this->getController()->duplicateKey($ak);
     return $ak;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:20,代码来源:key.php

示例3: editar

 public function editar()
 {
     //Modificar carpetas vistas
     $this->usarScaffold();
     //Conectarse a la base de datos
     if ($this->db == "") {
         $this->db = "default";
     }
     $conexion = $this->nucleo->getConexion($this->db);
     $conexion->Execute("SET NAMES utf8");
     //Obtenemos las llaves primarias
     $columnas = $conexion->MetaColumns($this->modelo);
     $where = "";
     foreach ($columnas as $c) {
         if ($c->primary_key == 1) {
             if ($where != "") {
                 $where .= " AND ";
             }
             $where .= $c->name . "='" . $this->par[$c->name] . "'";
         }
     }
     $modelo = new ADODB_Active_Record($this->modelo);
     $modelo->Load($where);
     $campos = $this->getCampos($modelo);
     $this->set("accion", "editarRegistro");
     $this->set("vista", "agregar");
     //Asignar campos
     $this->set("campos", $campos);
     //Asignar prefijo ID
     $prefijo = "id" . date("is") . rand();
     $this->set("id_prefijo", $prefijo);
     //Edicion adicional
     foreach ($campos as $c) {
         if ($c["primaria"] == 1) {
             $par .= "&" . $c["nombre"] . "=" . $c["valor"];
         }
     }
     $par .= "&prefijo=" . $prefijo;
     $this->set("parametros", $par);
     $this->set("editar_adicional", $this->editar_adicional);
 }
开发者ID:axelavargas,项目名称:UFPS-CMS,代码行数:41,代码来源:libscaffold.class.php


注:本文中的ADODB_Active_Record::Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。