Se agrega el campo DYN_VERSION a la tabla DYNAFORM

This commit is contained in:
Daniel Rojas
2014-06-27 17:00:34 -04:00
parent 2f379b8d86
commit f0c3c209ef
6 changed files with 82 additions and 13 deletions

View File

@@ -57,6 +57,12 @@ abstract class BaseDynaform extends BaseObject implements Persistent
*/
protected $dyn_content;
/**
* The value for the dyn_version field.
* @var int
*/
protected $dyn_version;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -126,6 +132,17 @@ abstract class BaseDynaform extends BaseObject implements Persistent
return $this->dyn_content;
}
/**
* Get the [dyn_version] column value.
*
* @return int
*/
public function getDynVersion()
{
return $this->dyn_version;
}
/**
* Set the value of [dyn_uid] column.
*
@@ -236,6 +253,28 @@ abstract class BaseDynaform extends BaseObject implements Persistent
} // setDynContent()
/**
* Set the value of [dyn_version] column.
*
* @param int $v new value
* @return void
*/
public function setDynVersion($v)
{
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->dyn_version !== $v) {
$this->dyn_version = $v;
$this->modifiedColumns[] = DynaformPeer::DYN_VERSION;
}
} // setDynVersion()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
@@ -263,12 +302,14 @@ abstract class BaseDynaform extends BaseObject implements Persistent
$this->dyn_content = $rs->getString($startcol + 4);
$this->dyn_version = $rs->getInt($startcol + 5);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 5; // 5 = DynaformPeer::NUM_COLUMNS - DynaformPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 6; // 6 = DynaformPeer::NUM_COLUMNS - DynaformPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating Dynaform object", $e);
@@ -487,6 +528,9 @@ abstract class BaseDynaform extends BaseObject implements Persistent
case 4:
return $this->getDynContent();
break;
case 5:
return $this->getDynVersion();
break;
default:
return null;
break;
@@ -512,6 +556,7 @@ abstract class BaseDynaform extends BaseObject implements Persistent
$keys[2] => $this->getDynType(),
$keys[3] => $this->getDynFilename(),
$keys[4] => $this->getDynContent(),
$keys[5] => $this->getDynVersion(),
);
return $result;
}
@@ -558,6 +603,9 @@ abstract class BaseDynaform extends BaseObject implements Persistent
case 4:
$this->setDynContent($value);
break;
case 5:
$this->setDynVersion($value);
break;
} // switch()
}
@@ -601,6 +649,10 @@ abstract class BaseDynaform extends BaseObject implements Persistent
$this->setDynContent($arr[$keys[4]]);
}
if (array_key_exists($keys[5], $arr)) {
$this->setDynVersion($arr[$keys[5]]);
}
}
/**
@@ -632,6 +684,10 @@ abstract class BaseDynaform extends BaseObject implements Persistent
$criteria->add(DynaformPeer::DYN_CONTENT, $this->dyn_content);
}
if ($this->isColumnModified(DynaformPeer::DYN_VERSION)) {
$criteria->add(DynaformPeer::DYN_VERSION, $this->dyn_version);
}
return $criteria;
}
@@ -694,6 +750,8 @@ abstract class BaseDynaform extends BaseObject implements Persistent
$copyObj->setDynContent($this->dyn_content);
$copyObj->setDynVersion($this->dyn_version);
$copyObj->setNew(true);