本文整理汇总了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);
}
示例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;
}
示例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);
}